iPhones will selectively delay charging past 80% if you're at home and if your usage history indicates that the phone will be left on the charger for a while longer.
That seems to me to be quite unfriendly to privacy. And given that I always charge my phone overnight and use my phone’s alarm function, it could simply use that as the target time to finish charging to 100%. No complicated location-based ML needed.
Having the machine upload or make available that information to someone else does. I don't know what the Mac does here.