Many dogs eat grass now and then without seeming ill before or after. Studies and reviews of plant-eating behaviour in dogs suggest that it often occurs in otherwise healthy animals and is not typically followed by vomiting. There is therefore no good scientific support for the simple explanation that dogs always eat grass to make themselves vomit.
Why an individual dog does it cannot always be said. The behaviour may be a normal part of a dog's foraging behaviour, and there are hypotheses about both fibre and evolutionary mechanisms. One published case describes how long-term plant eating decreased after a change to a diet with more fibre, but a single case does not show that a lack of fibre is the general cause.
It is more relevant to react if the grass eating suddenly increases or comes together with repeated vomiting, diarrhoea, abdominal pain, weight loss or reduced appetite. Also avoid grass that may have been treated with pesticides or fertiliser.