When you “jump the gun,” you’re starting to do something before the preparations for it are complete, or acting before the permitted or appropriate time. Like eating the cake before it’s been iced, perhaps.
However, the phrase originated with sports, not with cake. It derives from track and field races, where it began as “beat the gun.” The gun referred to is a starting pistol, a small revolver used to fire blanks to signal the start of a race.
To literally “jump the gun” (or pistol) means to cross the starting line, either accidentally or on purpose, before the gun actually fires, thereby gaining an advantage, even if only a few seconds, over the other competitors.
Here is an example from Crowther and Ruhl’s Rowing and Track Athletics, 1905: “False starts were rarely penalized, the pistol generally followed immediately on the signal ‘Get set!’ and so shiftless were the starters and officials that ‘beating the pistol’ was one of the tricks which less sportsmanlike runners constantly practised.”
One of the other early examples of the phrase in print has nothing to do with athletics, but is used figuratively. It’s from The Iowa Homestead, November 1921: “Give the pigs a good start; jump the gun, so to speak, and get them on a grain ration before weaning time.”
The word “jump” means to “make a sudden, unexpected movement” and is particularly appropriate to the phrase. It has been used this way in other phrases, too, such as “jump someone’s claim” and “jump ship” and more recently, “jump the queue.”
Another figurative use appeared in the newspaper Jacksonville Journal Courier in an advice column where people would write in to a woman named Abby for counsel:
“When you describe his condition as ‘dying,’ you create the impression that you are rushing him to the cemetery. He could live quite a while, so don’t jump the gun.”
That sounds like it might be an interesting story, but it couldn’t have had anything to do with either starting pistols or cake. I never jump the gun with cake. I don’t eat it until it’s iced (preferably chocolate) and even then, I save the icing itself for a final taste treat.