Today, if you need to make a last-minute birthday cake, you can grab a box of Betty Crocker cake mix, whisk it with some oil and eggs, and pop it in the oven. In early America, making a cake was an ordeal. "The flour should be dried before the fire, sifted and weighed; currants washed and dried; raisins stoned; sugar pounded, and rolled fine and sifted; and all spices, after being well dried at the fire, pounded and sifted," reads a common cake recipe in the 1841 cookbook Early American Cookery.

Related Content Stop Ruining Your Christmas Cookies! Follow These Tips to Better Baking

Besides this grueling work, you had to plan ahead. If you wanted your cake to be fluffy and airy, rather than dense and flat, you would need to do some serious work make it rise. For most of human history, the main rising agent has been yeast. As these finicky little fungi grow and divide, they breathe in oxygen and release carbon dioxide like we do. Mix them into dough and they’ll eventually fill it with the familiar bubbles of carbon dioxide that make baked goods rise—a process known as leavening.

In the 18th century and earlier, most baking was dictated by the delicate whims of respiring yeast. And we aren’t talking about dry or refrigerated yeast; this was way before fridges and commercial packaging. First you had to make the yeast, by letting fruit or vegetables or grains ferment. Once you’d done that, your hard-earned rising agent could still be killed or weakened by temperatures that were too hot or too cold, or contamination from bacteria. (Many early recipes recommend obtaining the help of a manservant.)

Even when it did work, leavening was a tedious process. "You're talking upwards of 12 hours of rising, usually more like 24 hours," says Jessica Carbone, a scholar in the National Museum of American History's Food History Project. Basically, forget about the joy of waking up and deciding to make pancakes.

So what changed? In a phrase, baking powder. Without this miraculous white substance, "We literally would not have cake as we know it now," says Linda Civitello, a food historian and author of the new book Baking Powder Wars. Today, baking powder "is like air, water,” Civitello says. “It's the one ingredient everyone has on their shelf." This cheap chemical factors into countless baked goods we buy and make every day, from donuts to hamburger buns. But how did this revolution-in-a-can come about?

In the 18th century, American bakers were already experimenting with less labor-intensive ways to make things rise. In addition to beating air into their eggs, they often used a kitchen staple called pearlash, or potash, which shows up in the first American cookbook, American Cookery, in 1796. Made from lye and wood ashes, or baker's ammonia, pearlash consisted mainly of potassium carbonate, which also produces carbon dioxide quickly and reliably. But this agent was difficult to make, caustic and often smelly.

In 1846, the introduction of baking soda, a salt that can react with an acid to create carbon dioxide, made things easier. But baking soda still needed to be mixed with an acid. Since it was cheap and widely available, bakers often used sour milk. This process was unpredictable, since it was hard to control how acidic the sour milk actually was, meaning it was difficult to know how much baking soda to use or how long to bake for.

The first product resembling baking powder was created by English chemist Alfred Bird in the late 1840s. Bird combined cream of tartar (an acidic powder composed of potassium bitartrate) and baking soda, keeping the two apart until they were to be used so they wouldn't react too early. Unfortunately, cream of tartar was an expensive byproduct of winemaking that had to be imported from Europe, meaning that it was out of reach for many poorer Americans.

In 1856, this need for a viable alternative drove a young chemist Eben Norton Horsford to create and patent the first modern baking powder. Horsford worked at a time when chemistry was only just beginning to be considered a respected field, and ended up creating the first modern chemistry lab in the United States at Harvard University. By boiling down animal bones to extract monocalcium phosphate, Horsford developed an acid compound that could react with baking soda to create those desirable CO2 bubbles.

"It's really the first chemical that opens the floodgates for chemicals in food," Civitello says.

Horsford later had the idea to put the two together in one container. Water activates them, so he mixed them with cornstarch to soak up any excess moisture and prevent them from reacting prematurely. Now, instead of purchasing two separate ingredients at the pharmacy (where chemicals were sold at the time), and having to precisely measure out each one, would-be bakers could grab one container off the grocery store shelf and be ready to go.

In the 1880s, Horsford’s company switched to mining the monocalcium phosphate as opposed to extracting it from boiled down bones, because it was cheaper. Marketed under the name "Rumford" (named for Count Rumford, who was Horsford's benefactor while he was a professor at Harvard), the baking powder is still sold today in much the same formulation.

Rumford wasn't alone for long in the baking powder industry. The company Royal Baking Powder quickly capitalized on the traditional cream of tartar that had been used ad hoc by housewives, while Calumet and Clabber Girl aimed to be more modern by using the acid sodium aluminum phosphate (alum), which was cheaper and much stronger than other baking powder acids. Hundreds of smaller manufacturers sprang up across the country, and by the end of the 19th century, the baking powder industry was worth millions of dollars.

Baking didn't immediately adapt to this new revolution, however, Carbone notes, since most recipes that women and existing cookbooks had were built around the old way of combining an acid with a salt. Baking powder companies worked to change this by releasing their own cookbooks, which served as both marketing and instruction manuals for their products. Some of these cookbooks are held today in the collections of the Smithsonian’s National Museum of American History.

In that same collection are remnants of the ugly wars fought within the growing baking powder industry around the turn of the 20th century. As alum baking powder companies like Calumet's and Clabber Girl's captured more and more of the baking powder market, Royal Baking Powder in particular fought to discredit them. In advertisements, Royal touted the "purity" of its more expensive product, while claiming that other baking powders were "injurious" to one’s health.

The fight culminated in 1899, when Royal managed to bribe the Missouri legislature to pass a law banning the sale of all alum baking powders in the state, according to Baking Powder Wars. Over six years of fighting, millions of dollars in bribes were paid, dozens were sent to jail for simply selling baking powder, and the muckraking press forced the resignation of the state's lieutenant governor. Even after the ban's repeal, baking powder manufacturers battled for decades into the 20th century through advertising battles and intense price wars, as Civitello chronicles in her book.

Eventually, the alum baking powder companies won out, and Royal and Rumford were acquired by Clabber Girl, leaving it and Calumet as the reigning American companies on the market. You don't have to look far to see baking powder's continued hegemony today: cooks around the world use it in everything from cupcakes to crepes, muffins to madeleines, danishes to doughnuts. "The fact that you can find it in every major supermarket tells you something about how it's been embraced," Carbone says.

So thank chemistry and modern science that you're not one of those early American bakers, pounding and sifting for all eternity.