Think of it as looking at your screen through AR goggles, where the goggles modify the image before it reaches your eyes.
Everything happens at the image level so there's no way Meta can obfuscate the DOM to make ads pass through.