How does a browser choose an image from srcset?

With width descriptors, the browser reads the first matching condition in sizes to estimate the image’s slot width. It combines that value with device pixel ratio, zoom and implementation factors, then selects a suitable candidate from srcset. The browser owns the final choice.
A 400 CSS-pixel slot on a device pixel ratio of 2 suggests roughly 800 source pixels. If the candidates are 640w and 960w, the browser may choose 960w. Network conditions, cache state and browser heuristics can affect selection, so the result is not a strict promise to download the nearest mathematical value.
When srcset uses density descriptors such as 1x and 2x, the displayed CSS size is assumed to be stable and sizes is not used. The browser chooses a density candidate based on the display and current scale. Do not mix width and density descriptors in one candidate list.
The src attribute remains a fallback and may participate as a 1x candidate with density descriptors. Once a larger image is cached, resizing the window may not trigger a smaller download because reusing the cached resource is cheaper and avoids visible quality loss.
Inspect the image’s currentSrc, computed layout width and network panel in a fresh session. Verify the real sizes rule before blaming the browser. Accurate intrinsic width descriptors and a candidate range around common slot sizes give the selection algorithm useful options. Add this case to responsive regression tests with long content, browser zoom and at least one narrow embedded container. Record the expected wrapping and focus behavior so later component changes can be checked against a known result.