The Medicinal Roots Of Root Beer Date Back To Pre-Colonial Times
What's now a category of mass-produced, canned and bottled root beer brands began as pre-contact American folk medicine. It all started with sassafras, a tree that's native to the northeast and southeast of the present day United States. Indigenous peoples had long used this plant (sometimes calling it "winauk," "pauame," or "kvfi") for various reasons. The Choctaw of the American South, for example, dried and powdered sassafras leaves and then used them to add thickness to their stews and soups.
Sassafras roots (and occasionally berries) were also used to flavor teas believed to generally bolster health and treat a variety of ailments. These included aches, colds, fevers, rheumatism, skin conditions, upset stomachs, and more. It didn't hurt, either, that sassafras' spicy root tastes like anise, cinnamon, citrus, and/or vanilla, which gave the beverage an enjoyable flavor. This drink, dubbed "root tea" by English colonizers, eventually became root beer.
A quick aside: While it's generally accepted that sassafras was the cultural root of root beer, it's also been said sarsaparilla was to thank. Sarsaparilla is taken from the roots of tropical vines in the lily family, which are native to Mexico and Peru. Now a common flavoring in modern medicines and sodas, sarsaparilla was also once its own popular soft drink, back in the day. Given the cultural significance of sassafras and root tea, however, it's likely sarsaparilla was just a co-collaborator at best.
Root beer was a small beer
From sassafras root tea to root beer, the next step on the road came in the form of 18th-century "small beers." American farmers took notice of Indigenous customs and started using myriad roots, herbs, flowers, and barks to make slightly alcoholic drinks (thus the "small"). Specific ingredients included sarsaparilla and sassafras but also allspice, birch bark, coriander, dandelion root, ginger, hops, juniper, liquorice, pipsissewa, spruce, vanilla, wintergreen, and yellow dock.
Components were heated in water to extract their flavors and create a wort, which was strained and sweetened with syrup, molasses, or honey. Next, yeast and extra water were added before fermenting the liquid in a barrel. The carbon dioxide produced would also turn the stuff slightly fizzy. Later, soda water was added, as well.
These drinks were fairly healthy, since the water involved was boiled and then sanitized by the carbon dioxide and alcohol. The end product was so popular that even Benjamin Franklin, George Washington, and Thomas Jefferson were known to imbibe it. Gradually, these small beers would go commercial.
Root beer went from homemade to store-bought
By the middle of the 19th century, enterprising individuals started selling root beer while marketing it as a health drink that could supposedly do things like cure cholera. Some companies distributed root beer all on their own. Others, such as shop owners, bought extracts from manufacturers and prepared the drink on site.
One particularly influential man, named Charles Hires, brought his "root beer" powder mix (incorporating various different ingredients) into the public eye at the 1876 Philadelphia Centennial Exhibition. This attention provided him with enough business to open a factory, and he would eventually supply root beer syrup to soda fountains across the country. Even then, better health remained a supposed benefit of drinking root beer, per Hires' ads. Hires also owned a pharmacy and supported the temperance movement, bolstering his health-conscious image. This branding especially came in handy for nonalcoholic root beer during Prohibition.
Root beer remained popular into the 1900s, but 20th-century science eventually disproved the idea that sugary sodas were any good for people. In the 1960s, the FDA also banned food and drinks from using sassafras oil due to its carcinogenic nature. So, root beer recipes nationwide had to be retooled. It was eventually discovered how to remove this oil from sassafras, and so, the original root in root beer could once again be used. Still, root beer soda has come a long way from root tea, and all sorts of ingredients are now included in root beer recipes.