They probably use a "ghost" device on their end (e.g.: Beeper with their Macs[1]) or a helper app you install on your Mac to plug into Messages (e.g.: AirMessage[2] with its macOS helper app).
1: https://www.xda-developers.com/how-to-use-imessage-android-b... -- see screenshot #2