The truth is, no one knows 100% for sure why cats (and dogs) eat grass. What we do know is that they do not have the enzymes necessary to digest most grass types, and that a wad of grass in the stomach almost always leads to a vomiting episode. Some of the theories out there include:
1. It is a natural behavior that has evolved so that the vomiting can also rid the body of other materials that can accumulate in the stomach such as hairballs, or feathers or bones from consuming prey.
2. Eating grass could be due to a craving for something the animal is not otherwise getting from the diet such as fiber or, as some have speculated, folic acid.
3. It could be just because "they just like it".
However, if your pet is vomiting at times (more frequently than once or twice a month) when grass is not involved- this could be indication of underlying disease, and a visit to your veterinarian is warranted.
There are special "cat grasses" you can purchase at pet stores- to satisfy that grass craving. Or you could grow your own. If it is young and fresh, it may be less irritating to the stomach and therefore less likely to induce vomiting.
I hope this has helped, please let me know if I can be of further assistance.