Every year, the camera manufacturers bring out their latest models touting an ever increasing number of pixels. In theory, the greater the number of pixels, the higher resolution the image. But there's a lot more to it than that.
The size and price of a camera is, in great part, determined by the size of the sensor. Smaller sensors used in most point and shoot camera are about 1/15 the size of those used in the typical DSLR cameras. Cramming the same number of pixels into a smaller sensor means smaller pixels. The smaller pixels just can't absorb the same amount of light as the larger pixels so you end up with noise (graininess) in your photos, particularly when taken under low light conditions.
The chart below is a comparison of sensors sizes used in various cameras - the three smallest sizes are those typically used in point-and-shoot compact cameras:
Here's a great video that explains the megapixel myth by "Pete the Gadget Guy".
In short, when shopping for a digital camera, don't go by the number of megapixels (regardless of what the clueless salesperson tells you). Look at the features, lens quality and how it feels in your hand. Don't buy into the megapixel myth!