what is it used for, and how and why might it appear in literature?

its used to make an obvious exaggeration
like "to wait an eternity"

"Hyperbole is a figure of speech which is an exaggeration. Persons often use expressions such as "I nearly died laughing," "I was hopping mad," and "I tried a thousand times." Such statements are not literally true, but people make them to sound impressive or to emphasize something, such as a feeling, effort, or reaction. "

the structure of hyperbole

The structure of a hyperbole often involves exaggerating a specific element of a statement for dramatic effect. It typically consists of an adjective, adverb, or verb that amplifies the intensity, duration, or quantity of something beyond what is realistically possible. For example, phrases like "I'm so hungry I could eat a horse" or "My backpack weighs a ton" use hyperbole to emphasize extreme hunger or a heavy backpack. The exaggeration helps to create a more vivid and memorable image or to emphasize the intensity of a situation.

In literature, authors use hyperbole as a rhetorical device to add depth, intensity, or humor to their writing. It helps to evoke strong emotions in readers and can make a story or poem more engaging. By using exaggerated and imaginative descriptions, hyperbole can create a sense of urgency, convey strong emotions, or highlight the absurdity of a situation. It can also be used to capture the attention of readers or to make a point more effectively by drawing their focus to certain aspects of a narrative.

Overall, hyperbole is used in literature to enhance the impact of a passage, bring attention to specific details, and make the writing more compelling and memorable.