A gerund is a verb form that ends in
-ing and functions as a noun in a sentence.
Common Roles in Sentences
Subject: Swimming is great exercise. (Answers what is great)
Direct Object: She enjoys painting. (Receives the action of the verb)
Object of a Preposition: He is afraid of flying. (Follows a preposition like "of" or "in")
It looks like a verb because it comes from an action word and can take an object.
It acts like a noun because it can be the subject or object of a sentence.
Opinions on exact linguistic classification vary, as some modern grammars view it as a nonfinite verb that takes noun properties, but standard teaching defines it as a verb acting as a noun.