When the diaphragm becomes irritated, it yanks down, causing air to rush into the throat.
When this air hits the voice box, it causes a hiccup.
Hiccups can be caused by eating too quickly or too much, an irritated stomach or throat, or feelings of nervousness or excitement.