What factor determines the selection of star mass?
And how we know that the number of massive stars is less than the number of low mass stars?
One popular argument for the Initial Mass Function is that the mass spectrum -- i.e., the fact that there are more low-mass than high-mass stars -- is inherited from the density spectrum of molecular clouds. In other words, stars form from the collapsing cores of molecular clouds, and the distribution of cores is already biased towards there being more low-mass cores than high-mass cores (this is in fact observed in molecular clouds). So you naturally end up with more low-mass stars than high-mass stars.
Of course, the natural next question is: why is the distribution of clouds cores biased towards low-mass cores? The usual suggestion is that it is the result of supersonic turbulence, and simulations of supersonic turbulence for conditions similar to those of a molecular cloud tend to produce density distributions similar the observed distributions.
For this, you need to look at the Initial Mass Function which gives you an estimate of the population distribution of stars in a galaxy. As you can see massive stars are formed exponentially less than low mass ones.
Another reason why we see a higher number of less massive stars right now (present mass function) is because more massive stars die out much much quicker than say some red dwarfs, which haven't had time yet to die (as their lifespans are longer than the age of the universe).
A star has its life span: more massive, less life span.
We are living at the point when the universe is about 13 billion years, when most of the massive stars have died.
But, if you look back into the universe at younger ages, it is believed that massive stars are more common. For example, Population III stars, which are the most ancient type of stars with zero metallicity, it is believed that they are all very massive.
So, the fraction of no. of stars with different initial mass actually depends on the age of the universe that you are considering.
The whole study about the fraction is called `initial mass function.' There are many factors determining that, e.g., age of the universe as mentioned previous, metallicity, rotation, and binary.
A combination of size and temperature of the protostar determines whether the actual star will be massive or small.
We can know that there are more small stars because we usually find the average amount of small stars and large stars in an area. As Rob Jeffries said, we usually just count them... Nothing too exciting.
Hope that helps!