Those chunks are proteins that were always present in the milk but were shaped and dispersed in such a way that they were tiny, suspended groups, rather than large, aggregated chunks. It isn’t until we disrupt their natural environment that they come to the surface. The proteins are perfectly normal and, in fact, are part of what makes milk (and alt milks) a good nutritional source. Other food items contain proteins that go from states of being dissolved to being coagulated. For example, think egg whites that begin as clear in raw eggs but turn white upon heating or severe beating.
Proteins are just long chains of amino acids that fold up in very complex, specific ways. If you take a piece of string and crumpled it in your hand, you’ll get an idea of how a protein might look. In a protein, that shape is held together by a variety of bonds at the atomic level, none of which are incredibly strong and thus are prone to disruption. If the bonds are disrupted, then, in most cases, the protein will denature (lose its shape) and come out of solution. In other words, it becomes a solid and is no longer part of the liquid.
There are a few ways to disrupt those bonds; in the case of milk and coffee, the most important disruption is acidity.
Acidity in a liquid is a measure of the concentration of hydrogen ions present in the liquid. The pH scale helps us talk about the concentration in easy numbers as well as give us an indication of whether hydrogen ions dominate a solution (as in an acid solution) or if bases dominate a solution (an alkaline solution). In solutions with a pH below 7 (as measured on the pH scale of 0 to 14), hydrogen ions dominate. A solution with a pH above 7 has a greater concentration of hydroxide ions (the counterpart ion species of a base).
Solutions with a pH of 7 (pure water, by definition) have an equal balance of hydrogen and hydroxide ions.
When proteins are in a solution, they can maintain their shape around a certain pH. In other words, the bonds holding its shape together are affected by the relative concentration of hydrogen ions. Casein, the primary protein in cow’s milk, will remain in solution at pH above 4.6. As the pH approaches that number, coagulation begins. The pH of black coffee varies somewhat but it tends to be around 5. Thus, milk doesn’t usually coagulate in coffee. The magic pH for soy proteins is a bit higher, around 4.9. Thus, unadulterated soymilk tends to coagulate in coffee.
There are a few reasons why milk will coagulate in coffee. One, the pH of the coffee may actually be near 4.6. Two, the milk being added might already be near that pH, normally due to lack of freshness where bacteria helped bring it down. Fresh milk has a pH around 6.7. However, as it ages, different bacteria consume molecules in the milk and produce acids as byproducts that we recognize as a sour taste. Most notable of these critters are lactic acid bacteria, which ferment lactose (the primary carbohydrate in milk) into lactic acid. However, they’re mostly active at room temperature. Other bacteria grow just fine in refrigerated conditions, though, including pseudomonads, enterobacteria, and Paenibacillus. As the acid concentration increases, the pH of the milk decreases. The lower the pH, the more likely mixing it with coffee will precipitate the proteins as the overall hydrogen ion concentration increases. As an aside, this is why spoiled milk curdles; the pH drops low enough to coagulate the protein!
To make matters more interesting, milk curdling is temperature dependent; milk can be at or near a pH of 4.6 and not coagulate, as long as it is cold. The moment the temperature rises, when the milk touches the hot coffee, the proteins coagulate. Nature designed caseins to coagulate at the temperature of babies’ stomachs.
There’s little one can do to prevent milk from curdling if the milk or coffee is particularly acidic. If the milk is getting old, acquiring fresher milk may solve the problem. Alternative milks, however, can’t be fixed by the consumer. Manufacturers of alt milks, fortunately, are aware of this problem and they solve it by adding buffers to their product. Buffers are molecules that can maintain the pH of a solution when an acid or base is added. Thus, instead of the acid in the coffee denaturing the proteins, the acid is captured by the buffer up to a point (eventually, the buffer is consumed and the pH will begin dropping). Of course, if these alt milks are of low microbial quality, they too will eventually coagulate.
At the end of the day, there’s only one guaranteed method to prevent milks from coagulating in the coffee. Don’t use them! Drink it black, instead.