Exclamation points are controversial. Writers can’t be blamed if they’re confused!
Exclamation has always announced straightforward shouting, alarm, surprise, excitement, amazement, disbelief, exasperation, or even just helpless flustering. In the eighteenth century, readers could expect melodrama:
And those were some of her last words! O how my eyes overflow! Don’t wonder to see the paper so blotted! (Samuel Richardson, Pamela, 43)
Exclamation points still serve in all those ways. But somewhere in the last century, the shouty little mark fell out of fashion in literary prose. Editors today frown on excessive exclaiming even in mainstream fiction, outside of books for young children and comic books. Plenty of passages worthy of alarm make do with commas, periods, or nothing: