There are two important things that effect image quality, the sensor and the lens. The sensor needs to be free of noise and as large as you can afford - not in terms of megapixels, but in terms of area, and the lens needs to be 'good'. Put simply, a cheap compact camera will have a tiny sensor and tiny lens - most probably with a massive number of pixels and ridiculous zoom range. Any lens that zooms more than 3-4x is going to be very compromised, top pros tend to use 'prime' lenses which don't zoom at all! Where pixels are concerned, 12 megapixels are generally considered to be all you need for all but very large prints, so don't be the victim of marketing men if you want quality.
My rules when you purchase:
- buy a compromise and you'll buy twice
- buy into a quality brand
- lenses last decades, cameras last 3-6 years
- avoid off-brands when you have adopted a brand (use Canon lenses on Canon cameras)
- limit the amount of gear, small quantity high quality