Instead, IPFS uses content-addressing, where the content is hashed and given a ID based on the content itself. So "foo" could have the ID A, while "bar" could have the ID B. No matter who added the content to the network, if the content is the same, the ID will be the same.
The benefit of this is that you can fetch the data from anywhere, and you'll get the data you wanted guaranteed (assuming the content is available somewhere on the network).
In terms of space, imagine being on the moon and requesting some website. With location-addressing, you have to be able to reach that particular node, and the data has to travel from there to you. With content-addressing, that content can be fetched from anywhere, maybe another node on the moon has it already, so it can fetched quicker from there, or some node in-between the moon and earth.
More reading about content-addressing: https://en.wikipedia.org/wiki/Content-addressable_storage
Magnet links and git are two fairly common technologies that uses content-addressing with lots of benefits.
(edit: of course, this is a simplification of both how IP, networks, IPFS, DNS and more works, but I hope it provides a fair overview at least)