Remember that when colonizing and non-Starfleet science missions occur, they may head for a designated location and not explore the areas around it. So a colony ship goes to planet 5 in a system, bypassing the others in and around the area, and remain ignorant of what's out there. That's where the new civilizations Starfleet finds are.
The Federation claims space in advance, then goes out to explore it.
well that's one explanation, but it wouldn't be likely to inspire confidence in colonists. Much like building a house on a fault line. But sure, space is big and it's hard to explore it all. One reason why all those space battle scenes seem so incongruous.