The Metta Sutta is a short Pali text, forty lines or so, recited daily across the Theravada world and used as protection, as a meditation instruction, and as a statement of ethics simultaneously.
It begins practically: this is what should be done by one skilled in goodness, be capable, upright, straightforward, easy to speak to, gentle, not proud, contented, unburdened with duties. Then it turns to the aspiration: may all beings be happy and secure. Then it does something structurally interesting. It enumerates categories in pairs designed to exhaust the field, whatever living beings there are, weak or strong, long or short, large or middling, seen or unseen, near or far, born or seeking birth, so that no being can fall outside the wish.
The image at the centre is the one everyone remembers: as a mother would protect her only child with her life, so should one cultivate a boundless heart toward all beings.
The exhaustive enumeration is the technique rather than the rhetoric. Metta as a meditation practice works by extending an attitude first to easy objects and then deliberately to difficult ones, and the sutta's pairs are a procedure for making sure the extension does not quietly stop at people one likes.
The commentarial tradition supplies a setting: monks meditating in a forest were harassed by tree spirits, went to the Buddha, and were given this to recite, after which the spirits became friendly. It is used as a protective text on that basis.