Every domain has at least two nameservers appointed to it and these nameservers hold the records for the domain.
If a server elsewhere on the world questions the nameservers for DNS records, it will frequently take a local copy of the DNS record.. This implies next time, it has to recognize what IP a domain makes plans to, it will have the answer already stored.
When the underlying changes have been made to the two original nameservers, the changes will sift through the remainder of the servers on the world until everything else is up to date. It is this that can take 24-48 hours and is known propagation.