As mentioned, a CDN is a large network made up of various servers located in multiple geographic regions. The PoPs are placed close to populated areas, in countries all over the world. For large countries, there may be many different PoPs.
The idea is to direct the user to the closest point of presence. When a user requests content from a site that uses a CDN, the request is routed to the closest PoP, where a web server sends the requested data. There are several different ways that a request can be routed to a specific PoP, one of which is IP Anycast.
Without a CDN
The image below shows how information travels to the origin server without a CDN. No matter where a user is based geographically, information must be requested from the origin server which can be a great distance away from the user.
With a CDN
When using a CDN, edge servers distribute static website data to visitors that are close to their geographic region. The connection is fast because it’s between Internet nodes that are close together. This means fewer hops and a faster flow of data.
Origin servers are able to deliver all the content available on a CDN. Its job is to serve as the “single source of truth” in the CDN. In other words, it contains the most up-to-date version of the file that the CDN knows about. Since all cached content has a limited lifetimespan (as web content can change over time) the CDN's edge servers must make a request to the origin server if it doesn’t have the most recently updated content.