In the sentence:
What are the benefits of earning money?
What part of speech is the word "earning"? And what function does it serve to the word "money" after that?
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.Sign up to join this community
As another answer notes, "earning" is a gerund. If you look up its headword form ("earn") in a dictionary, the part of speech is verb. In your sentence, it functions as the object of the preposition "of", so some people would say that it acts as a noun, and some people might even call it a noun.
"Earning" is the parent of "money", which functions as its direct object.
By the way, this is only one interpretation. Some people might refer to "gerund-participles", "prepositional complements", etc.