When you connect to a modern HTTPS site, the TLS ClientHello includes ALPN protocol IDs the client supports: "h2,http/1.1". The server picks one in the ServerHello.
It's what enables HTTP/2 and HTTP/3 without needing a separate port from HTTPS. The Alt-Svc header is the related mechanism for advertising HTTP/3 (QUIC) availability for the next request.
See also
