A typical mains-connected washing machine or dishwasher uses the water-supply pressure to admit water through a controlled inlet valve. A common valve uses an electromagnetic coil, called a solenoid, to operate its mechanism. The valve, water path and control signal all have to function for the intended fill.
This is a model of the mechanism, not a universal description of every appliance or a reason to open it. Check the installed machine’s instructions. Its valve arrangement and water-level sensing can differ from the example.