Like Images and and file of the website are stored in a web Server and the whenever the webpage is viewed, the browser requests the images from the webserver.
Ads are also stored on a server known as Ad Server. Ad serve may have many ads and based on the ad size to be shown on a page, ads will be placed in auction and a best ad is served on the webpage based on it size and performance.
Ads viewed are tracked as Impressions and Clicked are tracked as Clicks. This tracking mechanism between the Webpage > web Server and Ad Server is know as Third party Ad serving.