Hiccups happen when your diaphragm spasms. The muscle normally works to help you inhale and exhale, but sometimes it suddenly contracts and makes you gasp. Then that gasp gets trapped in your throat when your vocal cords shut, and you hiccup. Most hiccups are short-term, lasting less than 48 hours. They go away on their own. However, some hiccups are long-term; those that last more than 48 hours are called persistent hiccups, and those that last longer than a month are called intractable hiccups.
Such long-term, or chronic, hiccups can be caused by a variety of factors. Illness can bring on chronic hiccups, as can surgical procedures, tumors, stress and some medications. Damage to the vagus or phrenic nerves can cause chronic hiccups too, since they're the ones attached to the diaphragm. To correct long-term hiccups, doctors have to understand what caused them in the first place. Treatment can range from medication to surgical intervention.