The confusion here is rooted in seeing the domain in the address bar or using urls already for whatever we’re doing as developers.
And the key distinction, the point we miss is that actually these addresses are resolved by DNS and only then the HTTP process begins.
So, we are NOT sending the domain/url to the server directly, the browser does that for us putting that into the Host header.
It is explained here in detail: https://portswigger.net/web-security/host-header#:~:text=The%20HTTP%20Host%20header%20is,the%20client%20wants%20to%20access.