I've rebooted the office's WiFi router and, as expected, my laptop disconnects. Once I reconnect, I notice that my SSH session never dropped.
What about the SSH protocol makes this possible? Or does this have more to do with TCP/IP?
SSH by default have pretty long timeouts, defaults to TCP timeout and default TCP timeouts are long.
Any form of keepalive would actually make it drop connection sooner, because when client/server would see that keepalives are not getting to target it would drop connection.
So as long as your IP stays same SSH connection can persist for very long time, that if there is nothing "going on" to fill send/recv buffers
I'd say it's TCP. As long as the address is the same, anything that was sent while the network was down would have been treated as a dropped packet and resent. As long as the network wasn't down too long, the client and server will catch up on the lost stuff. If nothing at all was sent from either end while the network was down, then neither the client nor the server would even know there had been a problem.
In the last case, though, any protocol on a packet-switched network would have behaved exactly the same, so saying it's because of SSH or because of TCP isn't a complete answer.