The space of rank-deficient matrices has measure 0. Just think about random diagonal matrices, what's the probability that one of the diagonal entries will be exactly zero?
It's safe to restrict attention to diagonal matrices because the set of non-diagonalizable has measure 0 (proof). So any matrix you randomly pick is bound to be diagonal in some basis.
The issue with rank of a given real-valued matrix is that you typically can't compute it. In floating point precision you can't tell between floating point number that's exactly zero, and almost zero. Hence people use variations of "numeric rank" that are possible to compute.
The idea is to do a "weighted count" of non-zero eigenvalues. Smaller eigenvalues are down-weighted.
Two such "effective rank" measures are below -- $R$ and $r$ from Bartlett paper. They give slightly different ways of partially counting small eigenvalues which are close to zero. $r$ is also called "intrinsic dimension" by Tropp
$$r=\frac{\operatorname{Tr}A}{\|A\|}$$
$$R=\frac{\operatorname{Tr}A}{\operatorname{Tr}A^T A}$$
If you assume matrix unit trace and consider its vector of eigenvalues $\lambda$ , this two rank measures correspond to $1/\|\lambda\|_\infty$ and $1/\|\lambda\|_2^2$ and they are related like this
For $A$ of the form $X^TX$ with IID Gaussian distributed rows of $X$, $A$ follows Wishart distribution, and you can estimate mean effective rank $R$ like this and use similar principles to get the distribution.
For rank $r$, Tracy-Widom distribution may be relevant, also see this overview.