In different galaxies there appear different gas structures. What is the mechanism adapting certain gases in certain galaxies while excluding the other gases?
I totally agree with Charles Francis. The composition of the galaxies will depend on the generation of the galaxies as well as the constituent stars in the galaxy. If a galaxy contains huge numbers of high mass stars, then the probability of Supernova explosions in the galaxy will go up, thus filling the galaxy with higher mass elements. Also galaxy mergers may occur and this can also alter the composition of the new galaxy formed as compared to the parent galaxies.