some of these bodies became parts of the giant planets when drawn in by their gravity , he said , while others passed nearby and were flung away in a slingshot effect that propelled them out of the solar system .