I've researched this quite a bit but more importantly, I have worked extensively on cars my whole life. Tesla uses electronic braking systems (no surprise) but they aren't unique to Tesla, so this isn't some kind of mystery.
The electronic parking brake uses the EPB controller to engage the electronic parking brake piston which clamps the rear brakes, applies a specified amount of force (more than Park), measures the current and kills the motor(s) (to prevent damage).
Putting a Tesla in park engages the Bosch brake booster (iBooster) and master cylinder assembly which in turn engages the hydraulic brake piston that forces the rear calipers to clamp down. This is also how the brake pedal works. The amount of force for Park is pre-determined/programed, same as the electronic parking break.
So, the two modes (park and the emergency parking break) are operating on independent systems (though both pistons are combined in one caliper system to reduce unsprung weight and both are causing the calipers to clamp) which is why they sound different when engaged. More importantly, if one fails, the other can still be used.