The second comes from the little paper lining that the cupcakes are baked in.
Again, back in the old days where teflon coated and silicone pans and moulds didn't exist, cake tins were lined with grease-proof paper so that the cakes wouldn't stick to the tins.
They made turning out the cakes a lot easier.
Well, when cupcakes came about, little paper liners appeared here too, each in the shape of a little "cup", hence the name...