Explained step by step
Machines find each other by IP, but people remember names. DNS is the internet's phone contacts: you look up 'Mom' and the phone dials 099 123 456. You type example.com and DNS gives you back 93.184.216.34, the server's real address. Without DNS you'd have to memorize a number like that for every site you visit.
When the resolver doesn't know an IP, it looks it up by asking from the general to the specific, like finding a street: first the country, then the city, then the neighborhood. It asks the root server, which says who handles .com. It asks the .com server, which says who handles example.com. And that last one, the authoritative server, gives the IP. That's 8 steps in total, usually taking under 100 ms.
The resolver is the first stop of every DNS query: it acts as the middleman between your browser and the other servers, like a librarian you ask for a book who finds it for you. The first thing it does is check its cache, a memory of recent answers. If someone asked for google.com 5 minutes ago, it already has the IP and gives it to you in 1 ms. If not, it goes asking the root, the TLD and the authoritative server.
Root servers are the starting point of the search: they don't know example.com's IP, but they know who handles each ending (.com, .org, .uy). It's like an encyclopedia's general index that tells you which book to look in. There are 13 kinds of root servers, but they're not 13 machines: each kind has copies all over the world. That way a query goes to the nearest copy and gets a fast answer.
The TLD is what comes after the last dot: .com, .org, .uy, .jp. The TLD server knows every domain with that ending and which authoritative server handles each one. There are 2 groups: generic ones, like .com, .org and .edu, and country ones, like .uy, .uk or .jp. It's like a phone's country code: +598 tells you the country before the number.
The authoritative server is the last step: it holds a domain's official information, like the registry office that keeps your real address. If the record is an A, it returns the IP, for example 93.184.216.34. If the domain is an alias (a CNAME), it returns another name and the resolver has to start a new lookup for that name. If the domain doesn't exist, it answers NXDOMAIN, which means 'doesn't exist'.
There are 3 ways to ask DNS something. In a recursive query, the client demands the final answer: the resolver handles everything, like an assistant who comes back with the data ready. In an iterative query, the server gives the best it knows, or a hint about whom to ask, and the client keeps asking on its own, like being told 'go to window 3'. In a non-recursive query, the resolver already knows the answer (from its cache or because it's authoritative) and replies right away, with no more rounds.