Galaxies reside in dark matter halos, and the size of the galaxy is more or less proportional to the size if its halo. The distribution of the sizes of halos is given by the halo mass function (HMF), which is a declining function with mass — that is, the smaller the mass, the larger the number. At low masses, the HMF falls off as a power law, while at higher masses there is an exponential cut-off.
Hence, a galaxy such as IC 1011 is much rarer than a galaxy like M87, which in turn is rarer than Andromeda and the Milky Way.
An analogy is the size distribution of towns and cities. Capitals are rare, towns are common, and villages are even more common.
The reason the galaxy masses follow this distribution is first given by how dark matter in the early Universe fragments into clumps, and start collapsing and thus detach themselves from the Hubble flow. The first analytical attempt to solve the problem of structure formation assumed spherical collapse, and was presented by Press & Schechter (1974). Later, assuming ellipsoidal collapse, Sheth & Tormen (1999) gave an improved solution. More realistic forms cannot be calculated analytically, but must be estimated using large-scale $N$-body simulations (e.g. Tinker et al. 2008, Klypin et al. 2011).
As the Universe evolves, galaxies merge to form larger galaxies. Thus, the distribution depends on the time one considers. The figure below (from Klypin et al. 2011) shows how the HMF evolves from early times ($z=10$) to now ($z=0$). You'll see that the amplitude grows with time, because more galaxies are formed. From $z=2.5$ to $z=0$ you can also see that the number density of small halos actually decrease a little, because small galaxies are "eaten" by larger ones.
Halo mass function, i.e. number density of dark matter halos as a function of mass. Points are from an $N$-body simulation, while curves show the Sheth-Tormen approximation, which provides a very accurate fit at $z = 0$, but overpredicts the number of halos at higher redshifts.