The reason why pictures taken with HTC One looks better then with HTC One X:
1. HTC One has optical stabilization, which means even if you move just a little bit, image will be still so it will not be blurry and have more details. The difference between HTC One and HTC One X is similar as in this video:
https://www.youtube.com/watch?v=9q8k7KnMUe8&feature=youtube_gdata_player
2. HTC One lets more light in so it can produce more detailed picture. "the more the light = higher shutter speed = less blur = more detail". At same conditions HTC One X lets less light in so it needs slower shutter speed and creates blurry pictures.
3. HTC One has 4MP widescreen, and HTC One X only has 6MP if you are shooting widescreen so HTC One X actually has only 20% more MP than HTC One which has nothing to do with image quality. It only matters when you crop the image but again, if you crop image from One X that is just a bit bigger but has less light, slower shutter speed and almost always some blur the results are ..lets say "not useful for cropping".
4. HTC One has ISO from 100-1600 and HTC One X only has 100-800. Again that means HTC One lets more light in and image has more details and is not blurred that much. But high ISO means more noise on the other hand. Comparing ISO 800 between the phones = more noise on HTC One X and also less light - double minus.
So what are actually MP good for? Cropping. Period.
when you hit certain number of MP, it has no effect if you still raise them up. It is like a gas in a car..car needs some gas to run, if you give him more gas it will be heavier and consequently less efficient and slower but it will still run as if it would have "just enough" gas. But if you have a faster/sports car it will require more gas - like the "big" cameras with bigger sensor size can have more MP.