When you change a record at your DNS provider, the domain’s authoritative nameservers usually answer with the new value within seconds to minutes. Resolvers at ISPs, companies and public services such as 1.1.1.1 and 8.8.8.8 cached the old answer for as long as its TTL (time to live) allowed, so different users see the change at different times.
Plan a change by lowering the TTL a day ahead, to 300 seconds for example, making the change, then raising it again. Nameserver changes at the registrar take longer, since the parent zone’s NS records often have TTLs of up to two days.
During propagation some users reach the old server and some the new one, so keep both working until the old TTL has passed. Names that didn’t exist before can be cached as missing too (negative caching, RFC 2308).