'Being' in your example is the present active participle of the verb 'to be'. Participles are verbal adjectives - they can be used to modify a noun (in this case, the children), but can also take objects of their own because of their verbal quality. In this example, the object of the participle is the prepositional phrase 'at school'.
Using participles is a great way to pack the action in your sentences and to reduce your dependence on writing verbs out in separate clauses.
You can learn more by increasing your knowledge of English grammar, or by studying linguistics (but that could be beyond your needs if you're only seeking to learn prescriptive style rules rather than the ever-growing list of rules you encounter when approaching grammar from a descriptive standpoint).