When you shift the transmission into Park, a locking pin engages with the teeth on the parking pawl, which is connected to the transmission output shaft. This locks the output shaft and prevents the wheels from turning.
To release the parking gear, you must press the brake pedal and shift the transmission into another gear. This disengages the parking pawl and allows the wheels to turn again.
It is important to note that the parking gear is not meant to hold the vehicle in place on a hill. If you park on a hill, you should also apply the parking brake to ensure that the vehicle does not roll.