The answer may not be necessarily accurate; just how I understand it.
Keyboard buttons are switches. You press the key -> you complete a particular circuit -> hence send a certain signal to the pc telling what letter, number, or symbol.
Moisture may be causing shorts hence making a particular key's behavior ineffective (
current follows the path of least resistance). The same shorts may be responsible for the current to go in places where it shouldn't (might complete another key's circuit). The working of keys of a keyboard is dependent on the signals taking an expected path and water is introducing a number of unintended paths. And since the number of paths and nodes are many, the overall effect on the system is unpredictable. The insider process responsible for such is electrolysis and water is an electrolyte. Pure/distilled water is a poor conductor. Water containing impurities like minerals and organics conducts because of the presence of ions.
Electrolysis is the passing of a direct electric current through an electrolyte producing chemical reactions at the electrodes and decomposition of the materials. The main components required to achieve electrolysis are an electrolyte, electrodes, and an external power source. The electrolyte is a conductive ionic chemical substance which contains free ions and carries electric current (e.g. an ion-conducting polymer, solution, or liquid ionic compound). The electrodes are immersed separated by a distance such that a current flows between them through the electrolyte and are connected to the power source which completes the electrical circuit. A direct current supplied by the power source drives the reaction causing ions in the electrolyte to be attracted toward the respective oppositely charged electrode.
src
https://en.wikipedia.org/wiki/Electrolysis
Again, as a result, the intended flow of the signals may be disturbed and the effects on the complex keyboard matrix are unpredictable.