A good photo starts with a good photographer. The camera is merely a tool, and the quality of the photo depends on how you use it.
A good photographer should know what he or she needs to get the perfect shot. Before you know what you need, you have to know what kind of photography you would like to do. If you like to do low light photography and low light actions, then you need to look for a camera and lens that can handle low light, and you need to look for specs like larger sensor, larger aperture lens, good high ISO performance, image stabilization, manual/semiauto modes. If you like wildlife and sports photography, then you may want to look for longer focal length (or higher zoom power), faster frame rate, better AF performance, shorter lag time. If you like portraits, then a hotshoe to attach an external flash may be handy. So what specs matters to you depends on what style or type of photography you want to do.
You can't just look at the specs and decide which camera is better. Part of the specs are meant for marketing, not real performance. Reading reviews will also help you decide. But no camera excels in every aspect, so you need to know what specs matter to you most, so that you can decide which camera suits you best.
In terms of MP, you don't need a lot. 8 MP is more than enough for most people, unless you routinely make large gallery size prints for wall display or you like to crop a lot. If you do a lot of studio or landscape photography that has a lot of fine details, then higher MP may help.