In the medium where E.coli was growing

In the medium where E.coli was growing, lactose was added, which induced the lac operon. Then, why does lac operon shut down sometimes sifter addition of lactose in the medium?

Lac operon is switched on by adding lactose in the
medium, as lactose acts as inducer and makes repressor inactive.
Due to this beta-galactosidase is formed which converts lactose into glucose and galactose. As soon as lactose is consumed, repressor again becomes active and causes switching off of the system.