I'm not sure if anyone other than the engineers at Canon, Nikon, Sony, etc. can answer that question.
I usually describe digital cameras as computers that take pictures, because that is what they truely are. The way that this mode works is proprietary, as the various manufacturers have not shared how they have programed our cameras for us. This is "trust us - we know best" photography at its finest.
The background I have read regarding Nikon's approach is what I wrote previously. They have analysed many thousands of images and have crafted algorithms (computer programs) based on their work. I can definitely state that their algorithms do not recognize back-lit situations, have trouble with snowy scenes, etc. So, my view hasn't changed. I haven't seen any reports on Canon's, Sony's, Panasonic's, etc. etc. methodology, so how they set P mode is anyones guess.
My view is that this is really a snapshot mode, that works to give you a sharp and in focus image most of the time. It does not suit my style of photography; as I assume that shutter priority, aperture priority and manual modes really do work the way they always have. My camera behaves as expected, That being said I'm not quite the purist Donald is, and only shoot only on manual. I'll trust that my camera works the way I expect it to when I shoot,