Traditionally, these are called display ads.
They require more effort on the part of the site that produced the content, but are much more lucrative for that site.
Since most of the internet has been low-effort algorithmic slop for the last twenty years, tracking ads are more popular. They let low quality sites “steal” audience impressions from higher quality sites by displaying ads to people that happened to visit both sites.
I think personalized ads / algorithmic targeting (and even collecting the datasets that enable it) should be banned.