In a nutshell
DNS turns a name like www.example.com into an IP address. No server knows every name, so the lookup walks a hierarchy. Your recursive resolver asks a root server (which points to .com), the .com TLD server (which points to the domain's servers), then the authoritative server, which returns the address — and caches it for its TTL so the next lookup is instant.