You braking stops the car in its place. You then put it into park. There is some play in your drivetrain from inside the transmission to the wheels, and where that parking pin stops the transmission from moving may not be directly lining up with what it catches on. So if you have gravity trying to force you downhill, taking your foot off the brake allows the drivetrain components to move a little until they take up the slack in the system and then use the resistance of the transmission to hold the car.
Latest Answers