Police officers munching on doughnuts is such a common trope it’s a cliche. It’s nearly impossible to watch a TV show about the police without seeing a cop brush glaze-covered crumbs from his uniform (I see you, Chief Wiggum). Musicians from Ice Cube to the Bangles mention the fuzz’s affinity for doughnuts, and cartoons often poke fun at them—one of the most blatant recent examples being the officers in Wreck-It Ralph, who are literally a pair of frosted doughnuts. Some have even used the trope as a method of taunting real cops: A group of Occupy Wall Street protesters in 2012 tied doughnuts to makeshift fishing poles in an effort to mock officers assigned to their area. But where does this cliche come from? Turns out, the connection of police to doughnuts was born from necessity well over 50 years ago. 

In the late 1940s and early 1950s, before the debut of 24-hour fast food and convenience stores, doughnuts were one of the few late-night options for cops working the graveyard shift. In order to be ready for the breakfast rush, doughnut shops opened well before dawn. Unlikely to find a diner open in the middle of the night, cops settled for cheap doughnuts to refuel, often posting up at a table in the shop to work on paperwork. 

“The stereotype of an overweight officer drinking burnt coffee and eating a glazed doughnut is a relatively recent creation," Paul Mullins, author of Glazed America: A History of the Doughnut, told TIME. He's referring to the fact that the early-morning doughnut shop wasn’t common in big cities until after World War I, and not in the rest of the country for nearly another 30 years. 

Additionally, Mullins noted that since police officers aren’t allowed to accept free food while on duty, the cheap pastries were a welcome snack hours into a long shift. As for that logic, I can’t say I disagree. Seriously, what sounds better when still working at 4 a.m., a soggy sandwich made at home hours earlier, or a warm chocolate-glazed?