Hiccups are actually a spasm of the diaphragm.
They occur for the same reasons mosquitoes do- to annoy us humans!!
Hiccup: A sudden, involuntary intake of air caused by a spasmodic contraction of the diaphragm. These abrupt contractions may be caused by irritation of the organs near the diaphragm. The spasm draws air into the lungs through the larynx. As the air is pulled into the larynx, it strikes the epiglottis, causing the vocal cords to vibrate. This produces the hic sound.