The core tech is HTTP!
When a user visits your site, the user's browser loads your page. As it loads your page the browser also loads the Google ad script. When this ad script loads it makes a HTTP request off to Google servers. When they Google gets the request they provide a suitable ad back to the user. Google have a bunch of technology internally that decides which ad to show to your user, but that doesn't affect how the ad gets to your site.
This all happens in a very short time - fractions of a second - so it looks seamless to our eyes.