When you press the button on the knob of the gear change lever what exactly does it do?

I know it inhibits movement of the lever into/out of park and reverse gear but is this effected electrically or mechanically?