Epithets are used because of the constraints of the dactylic hexameter (i.e., it is convenient to have a stockpile of metrically fitting phrases to add to a name) and because of the oral transmission of the poems; they are mnemonic aids to the singer and the audience alike.
For example, the phrase for "everlasting glory" or "undying fame" can be found in the Homeric Greek as κλέος ἄφθιτον / kléos áphthiton and Vedic Sanskrit as श्रवो अक्षितम् / śrávo ákṣitam.
In other words, they descend from a fragment of poetic diction (reconstructable as Proto-Indo-European *ḱléwos ń̥dʰgʷʰitom) which was handed down in parallel over many centuries, in continually diverging forms, by generations of singers whose ultimate ancestors shared an archetypal repertoire of poetic formulae and narrative themes.
[2] In contrast to the more general term 'epithet' (ἐπίθετον), which is used in poetic contexts, for the ancient Greek religion, the epiclesis (epíklēsis (ἐπίκλησις; literally 'calling upon')) was used as the surname that was associated with a deity during religious invocations.
For example, Odysseus, Achilles, and Agamemnon are all referred to as "brilliant" (a general epithet for men) at various points.