Amp-img tag for a responsive layout

I am using amp (Accelerated Mobile Pages Project) technology in a new project.
My concern is about amp-img tag for images. According to this documentation ( you can use the attribut layout=‘responsive’ for responsive purpose and in conjonction you can use srcset,media,sizes attributs also for responsive purpose.

Likewise, the documentation says that the image will take the space of its parent container.

I don’t understand this logic. Why should we size the container to have the proper size of the image. If it works this way, it is very heavy to use.

Thank you in advance for your answers