You noticed the tiny hole
Why Do Pen Caps Have Holes?
That tiny hole is not just a manufacturing quirk. It is mainly a safety feature designed to allow limited airflow if a cap blocks someone's airway.
Quick answer
Pen caps have holes mainly for safety. If someone accidentally inhales a cap and it gets stuck in the airway, the hole can allow limited airflow and buy time until help arrives.
The hole does not make pen caps safe to chew, swallow, or inhale. It only reduces the chance of complete airway blockage.

Real purpose
Safety airflow
Common myth
Only for ink drying
Main risk
Cap stuck in airway
Still dangerous?
Yes
Next tiny mystery
More things hiding in plain sight

You noticed the can tab
Why Do Soda Can Tabs Have Holes?
Another tiny hole with a completely different purpose.

You noticed the little bumps
Why Do Keyboards Have Bumps on F and J?
Another small design detail hiding in plain sight.

You noticed the extra holes
What Are the Extra Holes on Shoes For?
Another useful hole most people ignore.