Up to a majority of dogs eat grass at some point, and many do so routinely. It is so common that researchers treat it as normal canine behavior rather than a disorder.
One hypothesis is that grass adds fiber or helps with digestion; another is that dogs simply enjoy the texture and taste. Some dogs vomit afterward, but most do not — eating grass is not necessarily a sign of illness.
A large survey found that most grass-eating episodes were not preceded by signs of illness, arguing against the "self-medication for upset stomach" idea as the main driver.
Occasional grass-eating is usually fine. Worry only if it becomes compulsive, is paired with vomiting/lethargy, or the lawn has been treated with pesticides or herbicides your dog could ingest.