A single hiccup unfolds as a short, stereotyped sequence. First, the diaphragm and the intercostal muscles contract involuntarily. The diaphragm is the dome-shaped sheet of muscle separating the chest cavity from the abdomen; when it contracts, it flattens and moves downward, enlarging the thoracic cavity. The intercostal muscles between the ribs contract at the same time, lifting and expanding the rib cage. Together these actions constitute an inspiratory effort: the chest is being prepared to draw air in.
Before air can actually enter, the glottis closes. The glottis is the opening between the vocal cords in the larynx; during a hiccup the vocal cords adduct (come together), sealing the airway. The inspiratory effort continues for a fraction of a second against this closed glottis. The moving column of air is stopped abruptly, and that abrupt interruption generates the sound we recognize as a hiccup.
The sequence therefore has two mechanical components that must both be present: the involuntary muscle contraction and the glottic closure. If the glottis did not close, the contraction would simply be a quick breath. If the muscles did not contract, there would be no airflow to interrupt. The characteristic sound is a consequence of their precise timing, not of either event alone.