The camera doesn't drive the lenses with different commands or voltage when one switches from off sensor to on sensor. A USM lens may struggle to do the back-and-forth of CDAF as readily as a STM lens, but that doesn't really play in phase detect, where the distance is known by the spacing between where rays intersect the linepair.
While the lens electronics don't change, the AF system does. Occam's razor, my man. It's obviously not a sound deductive method, but in this case the simplest solution, that on-sensor AF is different from off-sensor AF, is also predictable by the nature of the sensors used. Forget their size, spacing, etc, and just consider the filters in front of the image sensor. In order to re-construct color, every pixel has bandpass filters which only allow through a narrow band of the spectrum (reg, green, or blue). Off-sensor AF doesn't have a color filter array; they see the entire spectrum and thus have significantly more light to work with.
Both off- and on-sensor PDAF know direction.