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, who had since become a security officer assigned to the USS Enterprise, referred to Kirk by the same insult while arresting Kirk and Montgomery Scott after they had unexpectedly boarded the ship via transwarp beaming. (Star Trek)