What is the principle of voltage regulator

A voltage regulator is a circuit component that serves to stabilize the voltage in a circuit to keep it at a defined level. The principle of a voltage regulator is that when the voltage in the circuit increases, the regulator automatically discharges the excess current, thus reducing the voltage in the circuit; when the voltage in the circuit decreases, the regulator automatically brings in current, thus increasing the voltage in the circuit.