Well, in the comics, it's like this:
about 800,000 years ago, the Earth was visited by giant cosmic gods that we call the Celestials. They took the ancestors of humanity - Homo erectus, at the time - and transformed some of them through genetic engineering. The first group, however, turned out to be genetically unstable, so that each individual was unique, and over time cullings were deemed necessary to dispose of those who were too monstrous. They ended up living in vast cities underground. These beings are known as the Deviants.
The second group were pretty much perfect. They were beautiful, intelligent and gifted, and the Celestials made them part of the 'system', that is to say, the Earth, so that the would be immortal; even if they did die, they would be reformed almost instantly in 'the machine'. These beings would serve the Celestials and guard the planet. They went to live on mountaintops and high plateaus. They were known as the Eternals.
The third group was seemingly unchanged. They continued to evolve naturally until they had become Homo sapiens, and are known as Humans. However, the Celestials had in fact made changes to the effect that humans can develop super-powers. This is why super-powered people exist at all.
This has been Marvel canon for some time now. The mystery was the why of all of this. The maxi-series 'Earth X' tried to explain it: the Celestials reproduce by implanting an embryo of their own kind inside a planet and letting it develop for millions of years as it feeds on the planet's life force. In order to protect the embryo, the Celestials empower the local population to defend it, like a planetary immune system against alien invaders and natural disasters. Earth is one of the few planets that has managed to deflect even Galactus, the Devourer of Worlds; in 'Earth X' it is stated he does not so much feed on planets , or the life force of planets, as he hunts down and consumes developing Celestial embryos.
The movie will likely go its own way, though.