What happens when the stomach eats itself?

You are referring to an ulcer, and it is terribly painful. You can't keep food down, you can't lay down without belching up stomach acid, and you will be doubled up from the stabbing pain.