Websites can track you and can target ads and other information to you based on your online activity.
To prevent websites from doing so on your device, go to Settings then tap Safari. Scroll down and turn on the option Ask Websites Not To Track Me.
For the best chance of stopping targeted ads, you can also enable Prevent Cross-Site Tracking. Bear in mind this won’t remove ads completely, it will just mean they won’t be able to see your previous browsing history.