Leica M8 has a
10.0MP APS-H (27 x 18 mm ) sized CCD sensor . On the other hand, Casio EX-Z400 has a
12.0MP 1/2.3-inch (6.17 x 4.55 mm ) sized CCD sensor .
Another difference between these two cameras is that Leica M8's sensor lacks anti-alias (Low-Pass) filter. Removing anti-alias filter increases the sharpness and level of detail but at the same time, it increases the chance of moiré occurring in certain scenes.
Below you can see the M8 and EX-Z400 sensor size comparison.
As seen above, Leica M8 has a 17.3x Larger sensor area than Casio EX-Z400. Larger sensors give photographer more control on the depth of field and blurry background compared to smaller sensor when shot in same focal length and aperture.