Relationship between coordination numbers and stoichiometry
Surely there is a logic behind that, and a pretty simple one. Let's take a crystal and count all $\ce{Ca}$ atoms in it. We'll get some huge number N (possibly about as huge as $N_A$). Now how many fluorine atoms are there? Each $\ce F$ is a neighbor of some $\ce{Ca}$, so if we just count all neighbors of all $\ce{Ca}$, we won't miss anything... and will end up with 8N. But wait, each $\ce F$ is a neighbor of four $\ce{Ca}$, so it was counted 4 times! We divide by 4 to compensate for that and happily arrive at 2N, which is consistent with the formula $\ce{CaF2}$.

So yes, it is no coincidence that the ratio of coordination numbers is also the ratio of stoichiometric coefficients.