How does a washing machine regulate the water that is added?

i mean, what kind of device does a washing machine use. does it measure the water like a flometer or what?
3 answers 3