How does IPFS work offline?

An example would be computers on a LAN. They don’t require a connection to the Internet in order for IPFS to work between them. Another example could be computers in a mesh network that doesn’t have a connection to the Internet.