In order to let the vessels pass the lock, each chamber needs to be filled with 26,700,000 US gallons of water. The locks are operated using the gravity flow of water from lakes such as Gatún, Alajuela, and Miraflores.
https://www.marineinsight.com/guidelines/how-the-water-locks-of-panama-canal-work/

