How is IPLD data stored?

If I understand correctly, IPLD takes care of managing two entity types - Nodes and Links, which let the user give their data a logical structure, e.g.:

{
    "files": [
        {
            "name": "foo.txt",
            "mode": "777",
            "contents": { "/": "/ipfs/QmSomeLink..."}
        },
        {
            "name": "bar.txt",
            "mode": "755",
            "contents": { "/": "/ipfs/QmSomeOtherLink..."}
        },
    ]
}

But whenever the links need to be resolved, how does the implementation look the destination up? Are the contents obtained by traversing the DAG in some clever way, or is there maybe a separate, specialized lookup/hash table?