It's a hard technical problem and a harder social problem.
Keeping a private server secure is usually labor intensive, but in theory could be reduced to straightforward steps. But ultimately most people will never care enough to perform those steps. So we get "the cloud" of total enshittification.
Most people can't understand the boundaries of what is and isn't "necessary."
It's the give an inch problem. I want web sites to get only the data truly needed - enough to deliver the page, so my IP and a boolean for whether i'm on a mobile or desktop screen, little else. But they want it all.
You're thinking of "How does the client know what IP address to send the request to?" OP's point was about "How does the server know which IP to send the response to"