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,

Helpful Posts: 
Reply With Quote
If you feel comfortable shooting in P mode and you get the shots – USE IT! Programmed Auto is what it says, you can program this mode to suit your style, depending on the camera. With a Nikon you can still change WB, ISO, Shutter Speed, Aperture, control exposure value etc.

) to learn from, in the sense that you can see exactly what happens when you change any of the settings. Probably the only cameras where the viewfinder goes completely black if you select F 22 at 1/4000sec in low light.
Fortunately they escaped without injury. 