There's a few variances at work here. First, the batter is different. Usually a cupcake batter starts off with the butter and sugar being creamed together creating a lighter cupcake. A muffin is beaten very briefly so that the consistency remains quite dense. A cupcake will also have a glaze or a frosting on top whereas a muffin may have a sprinkling of sugar or a crumb topping. Also, a cupcake needs to have a small dome in order to apply the frosting - a muffin is encouraged to have a bigger bloom at the top making it almost mushroom in shape.