I believe the lens plays a role - I'm not sure it's really a closed loop with the AF sensor. Roger Cicala's data showing more accurate focusing with the more recent lenses/bodies was supported by the finding of rotational encoders on the USM lens motors. So, with older lenses (pre-2000) we had a basically open loop where the AF sensor determined magnitude and direction of the move and that was transmitted to the lens (look-move) - if the motor moved a ratio slightly off 1:1 from the instructions, AFMA would compensate. The newer lenses+bodies apparently have a closed loop where the encoder reports movement (look-move-confirm). But there may be tolerances in the encoder (e.g. detecting movement as other than a 1:1 ratio) for which AFMA could correct. I'm not positive the loop is closed with the AF sensor, i.e., look-move-confirm-look.
Certainly, a misalignment of the AF sensor with the image sensor is one factor that AFMA corrects. I can personally attest to that - at one point, I dropped my 5DII to the pavement. The camera was perfectly functional, but the sensor alignment changed such that all of my AFMA values (for ~8 lenses) shifted 10 units negative relative to the initial values.
Interesting, I've always assumed it was closed loop, since well, that's how I would have designed it, and all the pieces are there to close the loop. Perhaps the focus speed is hit too hard, but frankly I can't believe that since the second "look" would be nearly instantaneous.
That said, I'm no expert, I'm sure if it's true that focus using the phase detect is open loop, Canon has a very good reason for that.