You're confusing Activating with Registering.
SIMs auto-activate (once registered here). Maybe 10 - 20 years ago here you did have to Activate a SIM with codes.
Registering associates a SIM with an ID card. That can be done in person, or remotely using the service provider's app, to scan the SIM bar-code and take a photo of your ID.
Many of the promotional SIMs, e.g. 4 Mbps unlimited for 1 year sold online, come preregistered to someone. An obvious hole in the national security rationale (we're told) unenforced in recent years. There may have been a mini-crackdown when some of those massive SIM-farm operations were discovered a few years ago?
The link I provided above details this process (for AIS).