Spilling water to keyboard fixes keyboard weird
It's likely because many keyboards use membrane's with contacts under the keys which when you press a key, it joins those 2 contacts together sending a signal that the key has been pressed.
Over time, the contacts wear out or get dirty and no longer work or work intermittently.
The chances are, the water you spilled either added enough conductivity to the contacts that made the key appear to work or its washed some dried dirt out of the contact allowing the key work again.