The handbrake is not 100% reliable, it wears off and when its worn, it can slip on steep hills. It may also loose grip because of water or debris.
So as a backup/redundancy in manual transmission cars, drivers used to put their cars in gear in addition to the parking brake. If you are facing up the slope, you'd put the car in first gear or if you were facing down the slope, you'd put in reverse gear making it hard (not impossible) for the car to move with the slope.
Finally, there's a third level of redundancy by using the wheels (curb the wheels) which involves turning the steering in the opposite direction of where the curb is to the car if facing up the slope or same direction if facing down the slope. If the curb is on your right, turn the steering left. If the car starts rolling, it will roll on to the curb and it has to jump over it in order to move further.
When auto transmissions came around, there was no way to put the car in gear so the park gear was added which is not actually a gear. It can lock up the transmission to the same effect. There have been cases where the tab on the locking prowl sheers off under the forces so it can not be your only way of holding the car from rolling.
None of these systems are 100% reliable so you should decide on a case by case basis how much redundancy you want to implement. More severe the slope is, more you need. It should be in this order though:
- Parking brake
- Park gear
- Turning the wheels
Parking brake should be your primary system to use for holding the car. But if you think the slope is too steep or your brakes are weak at the moment, put the car in Park too. That's enough for 99% of the cases.