I don't have the real answer, but I remember back when Google Desktop was a thing, I had a widget that would allow me to send a text to anyone and it had a field for the "from" number.
So my guess is that the protocol they use asks the caller for the "from" number.
So my guess is that the protocol they use asks the caller for the "from" number.