Moons may yield clues to what makes planets habitable