Well, I'm no expert on the subject, but I think some childs are born with ... well, not the most pleasant feautures.
In less enlightened times they would be abandoned in the forests where troll families would take them in and raise them up, whereupon they slowly take on all the feautures classically associated with trolls - long hair, heavy weight, spinal deformation, etc.
This restructuring is a miracle of nature, after long field studies and gene analysis the following theory was devised - troll milk contains a symbiotic virus that will infect the breastfed childs cells and change the genetic code.
Still, you are right, this doesn't explain where trolls came in the first place, it is basically a question of what was first, the troll or the virus.
Some have advanced the theory, backed up by still missing links, that trolls did not originate from this world and were carried onto it by meteorites (of course not the trolls as such, but traces of organic matter from which the virii are made have been discovered), or seeded onto this planet by a mysterious precursor race (see annotations). The current consesus is however that trolls are a curious evolution of the neanderthal species that was long believed to be extinct.