The information page from the Compound Interest page of the same name describes it well (below).
A summary of the main points are that grass already emits small amounts of VOCs (volatile organic compounds) - mostly comprising of 6-carbon atom based aldehydes and alcohols.
When the lawn is cut, the main smell is from (Z)-3-hexenal, at which only 0.25 parts per billion can be sensed (smelled) by humans - this compound is short lived, hence why the smell is a freshly cut smell.
As a little twist, in research presented in the paper Air Pollution and the Smell of Cut Grass, the authors suggest that a significant proportion of aerosol VOC's in urban air pollution actually originate from the release of these chemicals when lawns are cut - and given the sheer number of manicured lawns in an urban centre, this starts to make sense.
Some of these released chemicals are highly photoreactive. The flux of VOCs is seasonal as well in many places, contributing to seasonal variations of VOC-based photochemical smog.
Within the article, VOC flux measurements taken in the urban area of Melbourne Australia indicate that 6% of the flux arises from uncut grass; however, this flux doubles when the lawn is cut. The combined flux is comparable to industrial sources.
It is suggested in the article, that
urban airshed, during the growing season, about one third of the emissions of
photochemically reactive VOCs come from grass and cut grass.