Here's why:
* It modifies a verb: It tells us how something is done. For example, "The dog wagged its tail happily." "Happily" describes how the dog wagged its tail.
* It can also modify an adjective or another adverb: For example, "He was happily surprised." "Happily" modifies the adjective "surprised."
Let me know if you have any other words you'd like to analyze!