The purpose of a CDN is to improve the delivery speed and performance of internet content. It achieves this by storing and serving website assets from servers that are geographically closer to end users, reducing latency and improving user experience. A CDN caches HTML pages, JavaScript files, images, videos, and other resources required for loading internet content efficiently.