It's unlikely intentional and actually just bad coding. When the page loads the browser sees a rough outline of the contents, which are marked up in HTML. The HTML and the associated stylesheets tell the browser where all the parts belong. This all together forms the DOM, which is interpreted to render the page, e.g. the colours and sizes of buttons, images, text. What happens sometimes is that an image is loaded but doesn't have a size specified in the first instance, so the browser only knows there'll be an image in a certain location, but not how big. Once the image is downloaded and rendered it is placed in full size, or alternatively the size is then set via JavaScript, but what happens is that the entire DOM is shifted as the browser now has to recalculate everything else to accommodate that image.
It's super annoying and as a software developer something I very much dislike website's doing, but with ads unfortunately the host site has little to no control over this. If the ads are always the same dimensions they could fix it, though.