STOP works thanks to the Telephone Consumer Protection Act (“TCPA”), which offers consumers spam protections and senders a framework on how to behave.
(Edit: It's relevant that STOP didn't come from the TCPA itself, but definitely has teeth due to it)
https://www.infobip.com/blog/a-guide-to-global-sms-complianc...