House was an artificial intelligence programmed by a few human colonists to care for their children in an underground bunker while the nations on the surface waged war.
House was able to create food and other items out of the earth. It also provided lessons for the five children and told them stories. The colonists on the surface wiped each other out, so no one was available to retrieve the children. They grew to old age, but with the minds of children.
Over the years, House, according to the Sixth Doctor, developed a dementia. It started killing the "children", starting with Jennifer. It killed Andrew just as the Doctor and Peri arrived in the TARDIS. It killed Emily as well, but when the Doctor tried to bring Roger and Carl to the TARDIS, they decided to stay, as this was their home. (PROSE: House)