Why several widths?
A phone doesn’t need the same 2000 pixel photo as a large monitor. With srcset, you list several widths and the browser picks the smallest one that still looks sharp on that screen. The sizes attribute tells it how wide the image will be shown, so it can choose before the page has finished laying out.
AVIF, WebP or JPG?
AVIF is usually the smallest, WebP is close behind and works in every current browser, and JPG is the safe fallback. The <picture> code offers them in that order, so each browser takes the best one it understands. Transparent images get a PNG fallback instead of JPG so the transparency is kept. If a format is greyed out, this browser can’t create it; the other formats still work.
What gets removed
Every image is redrawn and saved fresh, so camera details, GPS location, editing history and embedded colour profiles are left out. Photos taken sideways are turned upright first. Quality around 75 to 82 is a good balance for photos; graphics with sharp edges may look better a little higher.