When you visit websites , cookies are stored. Advertisers use cookies to fingerprint you and identify you and then show ads tailored to you.
I recommend Cookie AutoDelete for chrome and firefox browsers and set it to autoclean 15 seconds after you close a tab