Whether one is talking about butter or margarine, the basic concept is consistent: the goal is a water and fat mixture composed of at least 80% fat that is solid at or near room temperature. The source of these fats can be dairy products, animal fats, or various vegetable oils.
Margarine is a vegetable-oil-based substitute for butter often derisively dismissed by advocates of more “natural” food products. A graphic produced by “Herbs Health Happiness” and titled “Do People That Eat Margarine Really Know How It’s Manufactured?” attempted to outline the basics of the production process in a way that appeared to aimed at making margarine sound scary (and potentially harmful to consume):
With some caveats, this description is not all that far from the truth: several vegetable components have been used in the production of oils used in the manufacturing of margarine. Land O'Lakes brand margarine, for example, uses a mixture of soybean, palm, and palm kernel oil as their precursor material.
These oils likely would have been extracted at high pressure with solvents. Most edible oil production uses what is known as “food grade” hexane to extract these oils. While the solvent is highly toxic to humans, it is called “food grade” because of its purity, which chemically assures that it evaporates away at very low temperatures and with steam cleaning without leaving a residue. The claim that solvents remain in oil after extraction is dubious, as hexane evaporates at well under 100 degrees, but several later steps in the production process occur at higher temperatures. The resulting material is primarily made up of fatty acids, which are chains of carbon molecules attached to an acid group.
The graphic uses word “rancid” to describe the smell produced by the oils, but this is a disingenuous use of a ominous-sounding term. The word rancidity, scientifically, refers to the odor created by fats and oils that have been broken down into shorter, noxious fatty acid compounds. As butter production also involves such chemicals, however, rancidity is something butter production must also take into consideration as well.
As noted, it is likely that some pesticide residue remains throughout this process, though in many countries these products are monitored to make sure those levels fall below certain legal requirements.
The next steps in the process (five and six) are hydrogenation, where hydrogen gas is added in the presence of a nickel catalyst at high temperature and pressure. This process adds hydrogen molecules to chains of fatty acids to create fats that are “saturated” (or fully bonded with hydrogen) and therefore lack double or triple carbon bonds. The process raises the melting point of the oils, allowing them to be solid fats at room temperature while removing unsaturated fats. Some unsaturated fats, called trans fats, have been linked to cardiovascular health problems, and incomplete hydrogenation can produce trans fats during the hydrogenation process. Modern processes aim to prevent partial hydrogenation for this reason.
After the oils have been hydrogenated, the next step is to make sure the fatty mixture is made up primarily of triglycerides, which are compounds composed of three chains of fatty acids linked to a glycerol molecule. The “soapy” mixture to which the graphic refers is likely lye, an alkaline chemical generally made up of potassium hydroxide. Its description is a bit deceptive, as the addition of lye creates the soapy compound and is not itself the addition of soap. Soap (scientifically defined as a fatty acid salt) is a byproduct of the reaction that converts the fatty acids to triglycerides. The soap, along with other unwanted chemicals, is then removed after the reaction is complete.
The next step in the process, according to the diagram, is bleaching to make the mixture look more white. While a bleaching step is commonly employed, it is important to note that bleaching (the process of turning something whiter) does not require the addition of bleach (and for edible products it explicitly does not). Instead, the process generally employs activated charcoal or clays to lighten the final product.
While this process may sound like a great deal more chemistry than should be involved in responsible food production, that is largely because most of the chemical processes described above occur, at least for the butter-making process, in the body of a cow. Such a process includes myriad chemicals, enzymes, hormones, and feces, and also some “horrible” smells. If the butter production process is considered to begin (like the margarine production process) with plant material, a butter rebuttal infographic might look like this: