Hiccups are a very common phenomenon that most people experience from time to time. They are not usually the result of a medical problem unless they are persistent and cannot be stopped, and therefore they do not usually require investigation by your doctor
We do not entirely understand why hiccups occur or what drives them. They do not serve any obvious useful function, and it is likely that they are a leftover primitive circuit in the brain from evolution.
Physiologically, what usually triggers hiccups is distention of the stomach, such as with food or gas, or acid reflux into the esophagus (heartburn). You therefore may notice hiccups more right after a large meal or after consuming something that causes heartburn (such as coffee).
There are also more serious causes of hiccups, that occur when the diaphragm muscle is irritated but these are very, very rare.
Therefore, I would not worry
about this experience that you had. If you have multiple episodes of hiccups you may want to think if there is something you are doing to trigger them (such as eating large meals) and avoid that. Otherwise, this is a benign symptoms and does not mean that you have a medical problem. However, you should always talk to your primary care doctor
if you have general questions like these about your health.