Likely via sensors including feedback from a pressure switch.
Few if any domestic front loaders have user adjustable water levels. Amounts used usually vary by cycle (normal, permanent press, woolens, delicates, etc...). For normal cottons/linens wash water levels are low and rinses high.
My Speed Queen FL will fill the entire bottom of the tub to just an inch or so below the tub opening on all cycle except "Sanitize with Oxi". That cycle fills up to the bottom of the door for the Soak (if added), PreWash (if added), and Main Wash portions; rinses are at the normal level. I tried to get a picture for you but it might be a little hard to see with the water beaded up on the door.
We have the SQ FF7. I have no idea how many gallons a fill is, but my personal observation since acquiring it four months ago is that the water level never gets above the gasket level, no matter which cycle is selected, and I've tried all the cycles, in the name of research. LOL