The wifi antenna connection is analog with its own dedicated wiring.
First thought as well. Didn't see a way it could determine that tho.
I know PIs soft-require more power than the supplies most people give them, and they do things like CPU throttling when undersupplied. I think I've also read that WiFi and/or Bluetooth may stop working when underpowered. So it may not be a balancing thing so much as graceful degradation.