The most common way to form DMS is in the brew kettle. The precursor of DMS is the compound S-Methyl-Methionine (SMM), an amino acid formed in barley during the germination stage of malting. Once the germination (tricking barley into sprouting) is complete, the malt is then kilned (heated) to remove moisture then kilned even further depending on the type of malt that is being created. SMM is a thermally liable compound, which means that it reacts at a certain temperature and creates something else. Lightly kilned malts, such as Pilsner Malt, are not subjected to excessive heat for large periods of time and retain much of the SMM found within. Mashing (steeping malt in hot water) is usually done at a temperature that does not create DMS. However, it will release SMM into the wort (sweet liquid created in the mash) and is carried over into the kettle. When SMM is in the kettle and the wort is boiling, it create DMS.
Along with SMM, there is another compound is responsible for DMS. Dimethyl Sulfoxide (DMSO) is created when DMS gets oxidized and this can happen either in the kettle or already be present in the malt. DMSO is not as volatile as DMS and is not heat sensitive, therefore, it would remain dissolved in the wort even after boiling. DMSO is then reduced into DMS in the fermenter by yeast during fermentation. Since top-fermenting (ale) yeast tends preform more vigorous fermentations, the production of Carbon Dioxide (Co2) can literally scrubs away some of the DMS compounds out of the fermenter via the blow-off valve. Conversely, bottom-fermenting (lager) yeasts preform much slower so more of the DMS created from DMSO during fermentation can remain in the beer because the Co2 production is not as energetic. This is yet another reason why pale lagers tend to have higher levels of DMS compared to other styles.
DMS is quite volatile and generally escapes the brew kettle as steam with no issue. Homebrewers will encounter this as a problem if they cover the pot of boiling wort or before it has cooled down. The condensation collected on the cover is full of DMS and simply falls back into the wort. Other major contributors are a the use of high-protein malt such as those made from 6-row barley, lack of a vigorous boil, not cooling down the wort quickly enough, or bacterial infections from bacteria such as Enterobacter.
Thanks for reading. I hope you enjoyed it and learned a thing or two. Class dismissed!
Gilbert “Charlie” Perez, Certified Cicerone®https://beersensoryscience.wordpress.com/tag/dms/
"Beer: Quality, Safety and Nutritional Aspects" by by Paul S Hughes (Author), E Denise Baxter
"Malts and Malting" by D.E. Briggs