Why are the stars far away?

Just chance. Some stars are very close to each other. Some are in binary systems that are two stars rotating around each other. Some are so close that one rips the material of ft he other. The center of our galaxy is full of stars that are relatively close. We just happen to be on the outer edge of our galaxy where there aren't many stars.