This is how it works:
Keystroke: Pressing a key on a membrane keyboard causes the keycap to move downward and press on the elastic rubberdome.
Rubber Dome: This is a flexible rubber dome positioned under each keycap. It acts as resistance and creates the pressure point of the key. When the key is pressed, the rubber dome underneath inverts.
Contact: Beneath the rubber dome button lies a conductive membrane or contact. When the rubber dome is compressed, it closes the electrical contact with this layer, triggering the signal.
Return: Upon releasing the key, the rubber dome returns to its original shape, and the key is ready for a new keystroke.