why do dogs eat grass and then throw up

I have a little dog that often throw up after eating grass. I wanna know why do dogs eat grass and throw up after.