Many of the stars in a galaxy gather close to one another into 'clusters'. Some of the stars in a galaxy (like our own Sun) have planets revolving around them...but not all of them.
The stars have a general set pattern in their rotation...and their distance from each other keeps them safely apart. But this doesn't mean that there aren't accidents.
The stars (especially around the edges of a galaxy where many of the stars are 'dead') sometimes collide with each other and release small bursts of gamma radiation (as discovered in 2005 by a team of 30 researchers who had been looking for answers to the short bursts of gamma rays they had detected).
We're only able to see these bursts for short amount of time—generally only a few seconds. But the phenomenon had been noticed and the cause debated for over 35 years.
Galaxies also have a constant number of new stars forming within them. The gases and dust particles in a galaxy gather into a giant mass, becoming more and more dense as more matter gathers and gravity increases (the more matter something contains, the more gravitational pull it exerts).
Eventually, the gravity causes the hydrogen atoms in the center to fuse together to form helium. In fact, stars are nothing more than giant nuclear fusion factories, radiating the energy outwards in the form of light and radiation. The energy released from the sun turns to heat as it passes through the earth's atmosphere.