Onomatopoeia is often used in literature to create a more impactful and immersive reading experience.
For example, in Harry Potter and the Sorcerer’s Stone, J. K. Rowling uses onomatopoeia to vividly describe the moment Hagrid, the groundskeeper at Hogwarts School of Witchcraft and Wizardry, comes to collect Harry and knocks down the door:
“SMASH! The door was hit with such force that it swung clean off its hinges and with a deafening crash landed flat on the floor.”