I ran a lot of test a while back but finally gave up as I couldn't come up a solid set of factors that I felt really explain things.
For what I can tell, and I'm fairly confident about the following:
1) Being on a railroad and within five or less hexes of your HQ seems to give the best results.
2) Being on a railroad is better than not being on railroad OR being off a railroad and within five hexes of your HQ.
3) The closer you are to a railroad, the better off you, period.
4) Being closer to a supply source is better than being further away.
5) The rules provide for a 25% bonus being next to the enemy. I really couldn't tell if this was 25% or not due to attrition. However, there seems to be some benefit
6) I could not detect any impact of a leadership die roll having an impact.
7) However, a random factor of some type is applied to all refits.
Here are somethings that I suspect but I could never get a definite read on it:
1) Some type of prioritization system is used that seems to be based on the above criteria in who gets first replacements.
2) Once the prioritization system is determined, everyone gets XX number of replacements. This seems to be about 5% as a base rate. So, for example, let's call it 500 men.
3) For each unit, this 500 is adjusted up or down based on the seven factors above. For example (and I don't know if these are right, I'm just making this up as an example), an infantry division, in good supply, on a functioning railhead would get 500 based X 1.2 for being on the rail X 1.1 for being close to HQ X 1.0 for being in good supply for a total of 660 men in the first round. A unit with a total of modification of 300 men from the 500 base would get 300.
The total replacements would deduct 660 men + 300 men for these two units from the replacements for a total of 960.
4) Then some type of calculation is done for tje pool. On some days, I felt multiple rounds of replacements were phased in unti they were gone; other times, I felt some front wide calculation was done and everything was scored on that calculation. But virtually everyone on refit will get some replacements if they exist in the pool. And units on a railroads get a lot of replacements.
5) Now, there are some caveats. The replacements seem to depend on what's in the production/inventory pool. Some way, a separate round is done for infantry, mech and artillery. I can't determine how these pools are "created".
6) And all of this has been done on the Soviet side, not the German side.
So take this with a large grain of salt. It gives you some guidelines but not sure it gives any definite answers.