Myth vs Reality
It is mainly part of the opening mechanism.
The tab hole helps your finger grip the tab, while the tab pivots on the rivet and pushes the scored lid open.
You noticed the can tab
The hole in a can tab is not just for your finger. It helps the tab act like a lever so a small lift can punch open the lid.
Quick answer
The hole in a soda can tab gives your finger a place to grip and helps the tab work as a tiny lever. When you lift the tab, it pivots around the rivet and pushes the scored part of the lid open.
The straw trick is real, but it is a bonus use. The main purpose of the tab hole is opening the can.

Main job
Open the can
Mechanism
Lever + rivet
Bonus use
Straw holder
Not only for
Decoration
You noticed the can tab
After opening the can, you can rotate the tab so the hole sits over the drinking opening. Slide a straw through it and it can help keep the straw from floating upward.
Myth vs Reality
The tab hole helps your finger grip the tab, while the tab pivots on the rivet and pushes the scored lid open.
Continue learning

You noticed the tiny hole
Another tiny hole people often misunderstand.

The thing on your foil box you never pressed
Another packaging feature people often miss.

You noticed the extra holes
Another useful hole hiding in plain sight.