We've all done it - and it isn't pretty. Throwing up can be painful, relieving, or just plain annoying. A number of issues can cause you to vomit, from a pathogen getting into your stomach to motion sickness, anything that irritates or overfills the stomach. The reasoning is the same, the body needs to eject what's in the stomach.
What comes up is a mixture of stomach acid and food. If the vomit is green, then bile is mixed in, meaning it's coming up from the start of the small intestine.
The acid is why it burns, and it's propelled by the digestive muscles in a way that the body just wants to be rid of it so it's going to come out any opening it can find, including your nose by traveling through the sinus cavity behind the mouth.
If you breath in vomit it's called aspiration. This is what happens when someone chokes on their vomit in their sleep and why passing out from being drunk can be dangerous.
Because of the coordinated effort of the organs, vomiting is generally accompanied by a cold sweat.