The way AMP (Accelerated Mobile Pages) works is, you make a special version of your web page that behaves itself. Just a normal web page with some extra tags added, and a few bad things (like slow ads) removed.
When Google comes along to spider your site, it notices that you put in a link to that well-behaved page. It saves a copy of the whole thing, pictures and all.
Now Google has that copy at the ready, and should someone on a smartphone request it, Google can pop the whole thing up—words, images, scripts—in less than a second, even on a slowish network. It’s nice.