The concept
Anyone on the network can read what a browser sends. Before its first request, browser and server agree on a secret key in one round trip, and the server proves it is the site asked for.
The TLS 1.3 handshake is how a client and a server set up an encrypted, authenticated connection before any application data flows. Defined in RFC 8446 in 2018, it takes one round trip on top of the TCP handshake: the client sends a key share in its very first message, the server answers with its own and with the rest of the handshake encrypted, and the client sends its request right after its Finished message.
Each side sends the public half of a fresh key pair. Combining it with its own private half, each side computes the same secret, which no one watching the wire can. From the ServerHello on, everything is encrypted, the server's certificate included. The server proves it holds the certificate's private key by signing the handshake (CertificateVerify), and each side's Finished message, a MAC over the whole handshake, shows that no one tampered with it. By default only the server is authenticated.
TLS 1.2, defined in RFC 5246, takes two round trips: the key exchange completes only in the client's second flight, the certificate travels in plaintext, and no application data may be sent before the handshake is complete. A TLS 1.3 client meeting a TLS 1.2 server does not reconnect: the server answers the same ClientHello with a TLS 1.2 ServerHello.
With a ticket from an earlier TLS 1.3 connection, the client can resume with a pre-shared key and send its request in its very first flight: 0-RTT early data. RFC 8446 warns that this data is not forward secret and has no protection against replay across connections, so RFC 8470 lets clients put only safe requests, such as a GET, in early data, and lets servers refuse it with 425 Too Early.
Before trusting the keys, the client checks that the certificate names the host it meant to reach, here shop.example. RFC 9525 says to end the attempt with a bad certificate error when it does not. The 25 ms each way on this machine is modelled; the RFCs count round trips.