NEW ORLEANS - Everyone from Louisiana knows the drill. 

If you're eating a piece of king cake, and you discover a plastic baby or other trinket in your piece, you have to buy the next one. 

It is a tradition deeply ingrained in Carnival season, and one with a surprisingly long history. 

According to Matt Haines, author of The Big Book of King Cake, the ancient Romans had a tradition resembling that of the modern king cake baby. Their biggest festival of the year was Saturnalia, which, like Mardi Gras, involved music, drinking, and colorful costumes. During the celebration, they would eat a certain type of cake with a single bean baked into it. Whoever got the bean would be king or queen of Saturnalia. Then they would be sacrificed to the gods. 

"Maybe you shouldn't feel so bummed about buying the next cake," Haines joked, "it could be much worse."

He says Christians adopted the tradition and began eating the cake on Twelfth Night. Over the centuries, the custom spread and morphed. Some people kept the bean or used a nut, while others switched to ceramic or porcelain trinkets, many of which are now collector's items.

The custom was carried into Creole tradition. Then, in the 1800's, New Orleans' high society got a taste for king cake and, breaking with tradition, kept eating it after Twelfth Night.

"Every generation kind of inserted their own new traditions and new spins," Haines said.

But there was still no baby. That would have to wait for McKenzie's, New Orleans' beloved former bakery chain. 

According to Haines, owner Donald Entringer, Sr. saw a way to improve on the traditional bean. He knew that people would sometimes swallow it whole if they did not want to admit they had gotten it. 

Then, one day, a salesman walked in with a briefcase full of "frozen Charlottes"-- a type of small porcelain baby doll that was often baked into other desserts. Entringer started putting them in his king cakes and the idea spread. 

Today, just about every king cake in Louisiana leaves the bakery with a plastic baby inside. 

"We order about hundreds of thousands of babies," Nick Caywood of Caywood & Randazzo's said. He added that locals generally know what to do, but sometimes out-of-towners are confused by the tradition, wanting "to add multiple babies so everyone can get the baby."

Haines thinks the reach of the tradition, combined with its long history, are what make it special.

"It's this thing you see all over the place here, and it goes back not just a generation ago, not just a hundred years ago, but thousands of thousands of years ago."