system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What happens to a text message when the receiving phone is turned off?

And also, once the receiving phone is turned on, how does the text message service detect that?
gpt
> And also, once the receiving phone is turned on, how does the text message service detect that?

When your phone connects to the network, it performs what's evocatively known as a "handshake." This process of establishing the connection informs the network where to direct a call that will terminate on your handset, so the network has to keep a log of which handsets are connected and which aren't, otherwise you couldn't get calls.

As part of this handshake, the network also checks if you have pending messages, and if you do, it delivers them.