@TOMEJUS sorry i din't get ehat you are trying to say.
since there is no height and width set for img tag it will scale to fit the image inside the parent div, and since the image is taller than it is wider it will have gaps on both the side. Now when we set img width to 100% it's width is set to that of the parent container and on setting background-size to cover the image is stretched to cover the entire width of the img element. Now since image is taller then wider when the image will be scaled to fit the img element it will get taller then the parent element and will flow out of it, to prevent that we set the parent element overflow to hidden.
Hope you got it