It basically takes the address of the variable's name and does (pseudocode)
entry = table[(stringAddress >> 2) % tableSize];
while(entry != null)
{
if(entry.stringAddress == stringAddress)
return entry;
else
entry = entry.nextEntry;
}
The engine guarantees that two like strings will have the same address when used pretty much anywhere, so this works out nicely.
Of course you'll get a better understanding if you just look inside the engine yourself, it's fairly easy to read and will help you understand how it works a lot better than I can in posts.