Let’s imagine you live in Bari, Italy, and you just have changed the nameservers for your domain that is hosted in Phoenix, USA.
When you open your domain in a web browser, your request is not going to the hosting server directly, it has to pass through several ISP nodes first. So your computer starts by checking local DNS cache, then the request is sent to your local Bari ISP. From there, the request goes to the upstream provider in Rome, Italy, then connects to the ISP in Hamburg, Germany. After that, the request is sent to the first receiving point in the USA – New York, NY and ultimately, to the ISP in Phoenix, AZ. Here is an example of the request trace – the number of ISP nodes and their location will vary in each particular case:
Each of the ISP nodes checks its own cache to see if it contains the DNS information of the domain. If it is not there, it looks it up and saves it in order to speed up the loading next time and to reduce the traffic.
That is why the new nameservers will not propagate immediately – ISPs have different cache refreshing intervals, so some of them will still have the old DNS information in the memory.