Shortcodes are phonenumbers that are carrier-specific e.g. the three digit code that you use to access your voicemail etc.
The phone company knows the identity of the calling handset when it gets the text message with a high degree of certainty, as the handset is directly connected to its network.
So the person doing the transfer has to be in procession of the phone, or able to spoof or clone the phone.
Trivia: an attacker who redirects phonenumbers to gain access to a bank account https://williamedwardscoder.tumblr.com/post/24949768311/i-kn...
You just contact your existing provider, tell them you wish to leave and need the PAC code. After they beg to stay and throw you a sweetheart deal. They'll send it via text or post.
https://www.forbes.com/sites/jeanbaptiste/2019/08/31/why-twi...