text: what keeps the stars in a galaxie from just floating out into space? what is in the middle of a galaxy? a lot of people think there are massive black holes in the centers of galaxies. their gravity keeps the stars from "floating away". just like the sun's gravity keeps earth from "floating away".