When a content address is presented, how IPFS retrieves and presents the content?

IPFS is a distributed P2P file system. Whenever a random address is entered, what is the process IPFS retrieves and presents the content? Which node(s) does the node ask if the content is not local?. Detailed description or reference are appreciated.

Hi!

IPFS uses a Kademlia-based DHT for content routing. These should help:

https://docs.ipfs.io/introduction/how-ipfs-works/
https://docs.ipfs.io/guides/concepts/dht/