(I am acquainted with mathematics...) To supplement the other reasonable answers, it may be worth noting that there are generally several times more post-docs available (at R1 universities and high-end R2s) than there are tenure-track jobs at those universities. In my observation the ratio is something like 4 times more post-docs than tenure-track. So, roughly, only a smallish fraction of those post-docs will get tenure-track jobs at comparable institutions.
To get one at the same institution is, in fact, even rarer (statistically), because one tends to move to "somewhat lower status" institutions... in part because the high-end R1 postdocs who do not get high-end R1 tenure-track jobs do often get lower-end R1 TT jobs or high-end R2, squeezing out the people who did post-docs in those places.
Of course, it is not so stupidly simple as this, but statistically it is approximately so, and for obvious reasons. For individuals, of course, things can be wildly different.
So, yes, it is "possible", but statistically the chances are not so good. That is, the majority of post-docs at a given place would not turn out to be competitive for tenure-track jobs there. But, emphatically, this predicts very little for individuals.