Each pixel basically takes a weighted average of all the light that travels from a pixel-sized area in the world to the lens. As the picture with the dark area shows, this makes the debris form a dark area over a large part of the image. As the f number increases, the weighting gets stronger until 100% of it is a single line from scene to lens to pixel. At this theoretical f/infinity, you'll see all the lens's imperfections in perfect detail since the camera is essentially a pinhole.