Maybe the blind leading the blind, but...
I think that technically the counters should arrive at a scientific calculation of the surplus (i.e. look at all the 2nd, 3rd, 4th, etc preferences and calculate the number of votes to be distributed based on the actual surplus).
However, with a manual count, this is exceptionally time-consuming, and very often it is quicker to base the surplus redistribution on a random sample (which may or may not be the last 500 or so votes).
This method is faster, but not completely accurate. If the contest is close, especially for the last seat, then a re-count may be needed. In this case, the counters may need to count ALL of the votes and base the surplus redistribution that way. I think this is why re-counts can take ages. If we hadn't baulked at the idea of electronic voting, all this counting could be done much more quickly and, importantly IMO, much more accurately than is currently the case.