I have a Canon 5D Mk II full-frame digital camera. It has a 21 megapixel sensor and the images in good light look great. Excellent sharpness and no noise in the dark areas. I also have a Canon IXUS 240 HS compact camera. It has a 16 megapixel sensor and the images at full size look poor, even in good light. So poor that I have to half-size the photos that come out of it, reducing it to a 4 megapixel image, to get anything worth looking at.
I have no complaints about the IXUS. I like the camera and I think it does a very good job in good light. I like the camera because I can carry it around with me anywhere and a 4 megapixel image is usually enough. If I wanted better then I would be carrying around a bigger and more expensive camera.
So why the big difference between the 16 megapixels of the IXUS to the 21 megapixels of the 5D?
It is all to do with sensor size and lens quality.
The IXUS has a tiny sensor compared to the 5D. Only 1/30th the area. This is the standard 1/2.3" sensor that is used in nearly all small compact cameras and even the Canon SX50 HS superzoom camera. Instead of the full frame of 36 x 24 mm it has dimensions of 6.17 x 4.55 mm. Is it capable of capturing a lot of image detail? The answer to that is "yes". It could easily capture 4 megapixels of good image detail or more based on lens resolution in line pairs per millimetre with the lens aperture it advertises. Its sensor is 16 megapixels, so by the Nyquist sampling theorem of doubling the image detail frequency, then the 16 megapixel sensor is enough to pick up this 4 megapixels of good image data. So, in theory, it is good enough for the job. And when you consider how tiny the sensor area of our own eyes must be, then this should come as no surprise (I will be doing more comparisons with the human eye).
But in practice the compact camera can not give as good an image. A major problem is the small pixel size and the amount of light that each pixel gets. The sensor has only 1/30th the area of the 5D and yet it has a comparable number of megapixels. This means that the pixels are much smaller and have to produce an image using nearly 1/30th the amount of light. This leads to a much lower "signal to noise" ratio as well as random fluctuations due to the number of photons the pixels capture. So the pictures from the IXUS look speckly except in cases of very good light where the number of photons being captured is high enough. Think of it as putting empty cups outdoors just before a rain storm. After the rainstorm, the cups would be about equally full. If, instead, you put out narrow tubes of the same height as the cups before the rain storm then after the rainstorm there would be differences in the water level of the tubes depending on how many raindrops landed in each tube. The same applies to photons landing in the pixels. You get more variation for the smaller pixels and so the image has false bright and dark spots all over where more photons or less photons landed in the pixels and this gives the photo a speckly look. This is made worse by electronic "noise" showing up as light when there was none. If the sensor was large enough then this "noise" would be swamped by good signals and it would not be significant. We are not done yet. Light is a mixture of different coloured photons so with so few photons falling into the pixels then the colours from pixel to pixel will not be even over the same area where it should be even.
So we have the speckly image and noise problem. How do our own eyes cope with this? In the case of our own eyes the image is continuous and so our "pixels" (light cones) average out the speckliness and noise and that makes it go away.
Next comes the lens. If you read the promotion material then you will be impressed with how many elements the lens has and how most of the surfaces are aspheric. Reading this you might think it should lead to a sharp imag