A tank was being filled with water at the rate of 1.5 gallons/minute. By 10 A.M., it contained 50 gallons. Several minutes later, the water going into the tank was turned off, the plug was pulled, and the tank was drained at a rate of 2.3 gallons/minute. The tank was empty at 11:08 A.M. How many minutes did it take to drain the tank?

I know 50+1.5x=2.3(68-x) where x is the time in min after 10 that the tank fills, but why must these be equal.

LHS is the amount in the tank after x minutes and RHS is the amount that leaves the tank after x minutes.