What do marmite, gelatin, and molasses all have in common? They’re all foods that begin as byproducts of some other food – in this case, beer, meat, and sugar. You might not think of cattle while eating jelly or yeast while spreading Marmite on your toast, but rest assured, without one, you would not have the other.

Marmite, Vegemite, and other spreads like them are made from the dregs of the beer-brewing process. After brewer’s yeast has done its job of converting sugar into alcohol, it’s scooped up with a slurry of other ingredients, and ferried to a factory where it begins the process of being converted to something more closely resembling food (if you’re on the side which finds such concoctions edible).

There, the yeast cells are burst and the proteins and other substances from their interiors are separated from the cell walls using a centrifuge. That thick soup of protein is allowed to ripen, with enzymes native to the yeast busily breaking down molecules. Amino acids, the component parts of proteins, help give a rich, savory taste, and so the more the enzymes are allowed to work, the more umami the product. Evaporating off excess water and adding flavouring ingredients are the finishing touches that bring a yeast extract to fruition.

They might not seem like the most intuitive edible in the world, but yeast extracts were the brainchild of an acclaimed 19th Century German chemist named Justus von Liebig, also a pioneer of fertilizers and many key, early insights into organic chemistry. In 1816, when von Liebig was 13 years old, a volcanic eruption in what is now Indonesia produced what become known as “The Year Without a Summer” in Europe. It seems he never forgot the crop failures and famines that resulted, and much of his professional work focused on agriculture and nutrition. He also founded Leibig’s Extract of Meat Company, which later became Oxo, the manufacturer of beef bouillon cubes.

If you make beer at home and want to give your leftovers new life, the Nordic Food Lab blog has a recipe for scientific-minded cooks to make their own yeast spread.

Molasses, or black treacle, is the sludge left-over from the production of table sugar

Molasses, or black treacle, is the sludge left-over from the production of table sugar. The sugar cane is first crushed to release its juices, which are then boiled to evaporate the water. As the fluid thickens, sugar crystals begin to form, and to dry them out thoroughly, the mixture is spun in a centrifuge. The crystals then go to make table sugar, but the juice that’s left over – the mother liquor – can be further concentrated into a thick, sweet, slightly bitter syrup.

Molasses can be fermented with water and yeast and distilled to make rum, and the two products were part of the infamous Triangle Trade that linked Africa, the West Indies, and the American colonies and Europe beginning in the 16th Century. Molasses from the sugar cane plantations of the Indies was sent northwards to be converted to rum, rum and other goods were sent to Africa, and they were traded to acquire the final leg: enslaved people, to be traded for more molasses. British taxes on foreign molasses entering the American colonies and the subsequent orgy of molasses smuggling formed some of the backdrop of the American Revolution.

Gelatin is such a whimsical kind of food – bouncy, sweet, and brightly coloured when it’s turned into jelly — that it’s easy to forget that it’s actually an animal product. Boiling the leftover skins and bones of cattle, chicken, and pigs causes the connective tissue molecule collagen to fragment and disperse into the water. These strands can be filtered out and dried into a powder.

At room temperature, the strands are bonded to each other, but as you add boiling water and the temperature goes up, the bonds are disturbed and the molecules are free to form new arrangements, which they promptly do as the liquid cools, creating a 3D matrix of strands. They also attach to water molecules, surrounding themselves with skins of H2O, and the end result is a dense network of collagen threaded with water. Beware of putting certain kinds of fresh fruit into your jelly, however – pineapples and papayas, to name a couple, contain active enzymes that will snip through the chains of collagen and leave your dessert soupy.

Preparing gelatin today is a relatively simple matter from the consumer’s perspective, and for understanding the tremendous social role this development played, especially in the United States, I cannot recommend The Social History of Jell-O Salad highly enough.

But it was not always the case. Early recipes advised cooks to laboriously boil down their own calves’ feet, and jellies often involved the use of the dried swim bladders of fish, a product known as isinglass, or even shavings of ivory.

One thing is for sure: We will eat pretty much anything.

Join 600,000+ Future fans by liking us on Facebook, or follow us on Twitter, Google+, LinkedIn and Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Earth, Culture, Capital, Travel and Autos, delivered to your inbox every Friday.