Muffins are tiny quick breads. To refresh your memory about quick breads, please read about Baking Ingredient Roles.
To make most muffins, the dry ingredients are combined in a bowl, and a hollow, or well, is formed in the center. The liquid ingredients along with egg are combined in another bowl and beaten until combined. Then the liquid ingredients are poured into the well of the dry ingredients and the batter is stirred just until the dry ingredients disappear.
Muffin cups are greased or lined with paper liners, and the batter is dropped into the cups to fill them 2/3 or 3/4 of the way to the top.
During baking, leavening forms carbon dioxide, the egg and flour proteins and flour starches stretch to hold the little bubbles, then the heat coagulates or sets the proteins and starches around the little air bubbles, and browning occurs.
Muffin batter can be similar to cake batter, formed by creaming fat with sugar, then adding flour, eggs, and liquids. The texture of these muffins will, obviously, be similar to a cupcake.
And you can make muffins by following a method similar to making a pie crust. Fat is cut in to the flour, then liquid, eggs, and flavorings are added. These muffins are more flaky and tender than the other methods.
If you find your muffins have peaked tops and are full of tunnels when you break them open, that means gluten formed during the batter mixing.
In other words, the batter was beaten too much, allowing gluten proteins from the flour to form a stiff network. Just use a light hand with muffin batters, and your muffins will be wonderful.