Just about every lock on the canal (notable exceptions near Seven Locks) is of the swing gate type. There were two swing gates at either end of the lock. They were V-shaped so the weight of the water would help to keep them closed if the water levels on either side were different. The V always pointed to the high water.
When it was time to open the gates, the lock key was used to open the sluice valves at the bottom of the gate. The water would flow until both sides were equal. This would lift the weight from the gates and they could be easily opened. The boat was then allowed to enter the canal. There was only 3 inches to spare on either side and great care was taken not to damage either the boat or the lock.
After the boat was securely in the lock, the first gate was closed and the sluice valves on the second gate opened. The boat slowly lowers as the water in the lock drains to the lower level. The first gate is now held closed by the weight of the higher water.
Finally the second gate is opened and the boat passes. The gate must be closed in preparation for the next locking through.