Why is the empirical formula of sodium chloride NaCl?
The empirical formula of, say, $\ce{P4O10}$ is $\ce{P2O5}$ but that doesn't mean that each phosphorus is bonded to only 2.5 oxygens. It's perfectly possible (and in fact it is pretty much a requirement) that if Na has 6 nearest-neighbour Cl and Cl has 6 nearest-neighbour Na, then the overall stoichiometry is NaCl.

Let's say, for example, that there are $n$ sodium atoms in a sample of NaCl. Then, if each $\ce{Na+}$ atom has 6 nearest-neighbour $\ce{Cl-}$ ions, then at first glance we might say there are $6n$ chloride ions.

However, since each $\ce{Cl-}$ ion has 6 nearest-neighbour $\ce{Na+}$ ions, this means that in the earlier calculation we counted each $\ce{Cl-}$ ion 6 times (once per $\ce{Na+}$ neighbour). So in fact there are only $6n/6 = n$ chloride ions, leading to a stoichiometry of $1:1$.

Maybe if this is too complicated for you, you can reduce it to one dimension. Consider the following (infinite) arrangement of red and green trees along a road:



Surely you'd agree that each red tree has two green neighbours, and each green tree has two red neighbours. Yet the "stoichiometry" is obviously $1:1$.

Now if you tile that in three dimensions, you get the $\ce{NaCl}$ structure.