The OED separates the two (food) definitions of 'muffin' as follows:
"a. Originally (now Brit. regional): any of various kinds of bread or cake. Now: spec. (in N. Amer. generally known as English muffin) a small, flat, cake made from yeast batter and cooked on a hotplate, usually eaten split, toasted, and spread with butter, jam, etc., esp. for breakfast or tea
b. orig. N. Amer. A small, usually sweet sponge cake, baked in a cup-shaped container. Freq. with modifying word indicating the flavour or additional ingredients."
So the type of muffin that you're referring to is simply the American name for a particular type of cake. It's much the same as baking some biscuits and calling them 'cookies'.
Of course, some of us are old enough to remember a different type of Muffin!