A cupcake was a traditional Earth pastry. It was also a term used as an insult.
In the alternate reality of 2255, James T. Kirk insulted a Starfleet cadet named Hendorff in an Iowa bar by calling him "Cupcake". Three years later, the same man (then a security officer on the USS Enterprise), referred to Kirk by the same insult while arresting Kirk and Montgomery Scott after they had unexpectedly come aboard the ship via transwarp beaming. (Star Trek)