Maytag top load - water randomly filling washer

We have this unit for 14 years.
In the last year or so, a few times a week, when the washer is off and the lid is open, water from the top starts to fill it with no apparent reason. It would happen for a few minutes and then stop.

What should be fixed?

Thank you!

Need to determine if it will do it with washer unplugged. If it does, then the water inlet valve assembly is failing. What is the model number of the washer?

Eric

Thank you for the answer! The model number is MAV6451AGW.

As I wrote, it’s completely random, so I’ll have to unplug the washer for a few days for the test. I’ll try to follow it. Thanks again!