Studies in Genesis 1
In the beginning, God created the universe. [Genesis 1:1 ESV]
God built and designed the universe. Before, there was nothing. Then there was something. He created ex nihilo, out of nothing. Then, from matter and energy God brought into existence He designed and fashioned all there is in the universe. He built the elements, made stars and solar systems and galaxies and set everything in motion.
Each galaxy is made of billions of stars with the greatest concentration toward the center. This massive concentration of stars has a gravitational pull which keeps them within the confines of the galaxy which moves and spins at a constant rate of speed.
Every star is unique and may be smaller than our sun or so large our solar system would fit within its diameter. Every star has a different color, level of energy, mass and temperature. Every star has gravity pulling near objects toward its self. Orbiting objects maintain a steady speed and distance from its star because of the exact pull of gravity.
There are uncounted galaxies filled with uncounted stars. We may make educated guesses about the number of galaxies and stars within each, but cannot know. Yet, God knows the exact number of galaxies and stars because He created them and placed them in the universe by design. No star is birthed or dies without His knowledge and direction. Every galaxy, star, solar system, planet, object with their mass and speed and unique characteristics are there because of the design of God.