Comment by vFunct
I actually used to design image sensor chips. The dynamic range is due to the electron well size. Each pixel has a diode that stores typically between 10,000-100,000 electrons in them. When the shutter is open, each photon that arrives pushes out an electron across the diode. When the shutter closes, sensors count how many electrons remain. This is how they calculate how much light each pixel received.
The well size itself is usually a function of the pixel size. A larger pixel means a larger diode that can store more electrons, and hence a larger range of light that can be measured - dynamic range.
So there's a tradeoff between image resolution and dynamic range, for a given sensor size?