Gangers were developed to work in environments too dangerous for people. Controlled remotely by a human operator they soon saved lives and money and most believed a Ganger was simply a tool, little more than a fork-lift truck. But the Doctor immediately recognized they were much more, insisting they had a mind and a soul.
Gangers are formed from a type of flesh; once a reading has been taken it can be manipulated into anything, even replicating a living organism.
When the Doctor visited a mine run by Morpeth Jetsan a storm struck and 'hardwired' the Gangers. They evolved. Something new was being created - independent and with all the feelings and memories of a human. Amy also had a 'doppelganger' which traveled with the Doctor for several adventures prior to the battle of Demon's Run.