Ads follow you around the web. Here's how they know where you've been.
When you visit example.com, it sets cookies. Those cookies only work on example.com — they track your activity on that one site.