Scientists have overwhelming evidence to show that all species now alive on Earth evolved from a common ancestor; but figuring out where that common ancestor came from or how it originated is a difficult puzzle. Although scientists don't yet know how life originated here on Earth, they have a lot of tantalizing clues. Based on what we know, we can't be certain how the first life came about, but we can logically reconstruct what may have happened. Surprisingly, the best guess is that heterotrophs were first on scene.
Scientists divide living organisms into two broad classes depending on where they get their energy. Autotrophs use sunlight or another external source of energy to power the synthesis of chemical compounds like sugars that serve as food for the organism. Heterotrophs, by contrast, take up food from their environments -- typically, though not necessarily, by eating other organisms. Plants are autotrophs because they rely on photosynthesis to make their food, whereas humans are heterotrophs because we eat plants or animals.
Autotrophs as we now know them most likely evolved secondarily to the first life forms. The biochemical machinery that photosynthetic organisms like plants use to synthesize food is very complicated and probably required a significant amount of time to evolve. But most heterotrophs today depend on autotrophs for their food. So any successful scientific hypothesis about the origin of life must explain either how autotrophs came into existence or where heterotrophs could have obtained their food before the origin of autotrophs.
Past experiments have demonstrated that conditions present on the early Earth favored the formation of compounds like amino acids and other basic building blocks for life. According to the so-called heterotroph hypothesis, the first living organisms were heterotrophs. They consumed these "building blocks" present in their environment and used them for food. Sometimes this is called the "primordial soup" theory, because it envisions an early Earth rich in organic compounds that the first emerging organisms could eat.
If the first organisms were indeed heterotrophs, evolution would gradually have given rise to autotrophs -- organisms that could make their own food. As supplies of amino acids and other basic building blocks in the primordial soup began to run low, these first autotrophs would have had a huge advantage over the competition. Eventually, organisms that could eat the first autotrophs evolved to take advantage of this new source of food and nutrients. We may never know for certain whether this is indeed what happened, but the currently available evidence suggests that this hypothesis is a reasonable best guess as to how autotrophs and heterotrophs came into being.