What is the working mechanism of Shimano Power Modulator? How does the Shimano Power Modulator works? 
Since there are at least 3 power modulators from Shimano, I refer to the SM-PM40, a little cylinder that runs on the front brake cable.
I never had the chance to open one ... I actually never tried one.
There appears to be a couple of things that Shimano calls 'Power Modulator'. I think the I think the basic idea of both is to prevent inexperienced riders from over-braking and losing control.

If you are talking about coaster brakes, it's basically a clutch which limits braking force. https://bike.shimano.com/en-EU/technologies/component/details/power-modulator.html

There is a mechanical disc brake version too which changes the lever ratio as the brakes are applied.  https://bike.shimano.com/en-EU/technologies/component/details/power-modulator-unit.html