Originally, electronic keyboards had wire busses and short lengths of gold-plated wire to do the switching when a key was depressed. For the last 20 or so years, a cheaper membrane switch (using Force Sensitive Resistors) has been used on many keyboards. The switch 'contacts' are on a PCB, and are made when a conductive bead attached to the underside of a special rubber mat (the membrane) are pressed onto the PCB by the key.
I took the keyboard (a Kurzweil KME61) apart, and sure enough there was a speck of dirt on one of the top C contacts. It was easy to clean this with a miniature brush. While I had it apart I checked all the membrane switch pads, and found some others that had dirt in them too.
The problem really is that dirt gets in there in the first place. Membrane switches are designed to attach with lots of little feet that fix to holes in the PCB. This system does not seal the contacts off from the dust which invariable falls down between the keys. Unlike the old open contacts, once dust works its way in there is no way for it to get out again. If the keyboard was always sitting horizontal in a clean room it would be ok, but if the keyboard is moved, then when it is tilted, some of the dust will get under the membrane, and eventually interfere with the key contacts.
So, to stop this happening again I use masking tape to seal around the edge of the membrane switch. Why the manufacturers don't do this I don't know. Maybe they save 30c per unit!