Trauma, that’s what. It’s the smell of chemical defenses and first aid. The fresh, “green” scent of a just-mowed lawn is the lawn trying to save itself from the injury you just inflicted.
Leafy plants release a number of volatile organic compounds called green leaf volatiles (GLVs). When the plants are injured, whether through animals grazing on them, you cutting or mowing them, or even just unintentionally rough handling, these emissions increase like crazy.
The rush of chemicals does a few things. Some of the compounds stimulate the formation of new cells at the wound site so it closes faster. Others act as antibiotics that prevent bacterial infection and inhibit fungal growth. A few spur the production of defensive compounds at un-wounded sites as sort of a pre-emptive fortification. And still others react with other chemicals to act as something like distress signals. Scientists found in one study that the saliva of certain caterpillars reacts with the GLVs released by coyote tobacco plants to make them attractive to the "big-eyed bugs" that regularly eat the caterpillars.
Thankfully, the mix of lawnmower blades and GLVs won't get you eaten. Instead, humans get a treat. Among the GLVs released by damaged grass are a group of eight related oxygenated hydrocarbons, including aldehydes and alcohols, that cause the “green odor.”
There may be a high cost to that wonderful smell, though. These compounds are precursors to ozone formation, according to Australian researchers, and can contribute to the formation of photochemical smog in urban areas.