Myth vs Reality
It had a real job.
It was a small protective pocket for a pocket watch, built into jeans when jeans were practical work clothing.
You noticed the tiny pocket
It looks too small to be useful for modern stuff. That is because it was made for pocket watches, back when jeans were workwear.
Quick answer
The tiny pocket on jeans was originally made for a pocket watch. It kept the watch snug and protected when jeans were workwear. Pocket watches mostly disappeared, but the little pocket stayed.
Today people often call it a coin pocket, but historically, “watch pocket” is the better name.

Original use
Pocket watch
Best name
Watch pocket
Modern use
Coins, cash, small items
Still there?
Mostly tradition
You noticed the tiny pocket
Do not expect every tiny jeans pocket to fit modern items. Some are deep enough for coins or folded cash, while others are mostly decorative because the pocket is too shallow.
Myth vs Reality
It was a small protective pocket for a pocket watch, built into jeans when jeans were practical work clothing.
Continue learning

You noticed the backpack patch
Another feature that outlived its original purpose.

Those tiny copper dots on your pockets
Another small detail built into old workwear.

You noticed the extra holes
Another clothing detail with a practical use.