Some keyboards have aftertouch which is a pressure sensor and responds to varying amounts of pressure after the key is pressed and held down. Some (couldn't tell you how many) fully-weighted keyboards work in a similar way to pads: They have a hammer at the other end of the key which hits a pressure sensor, and the note velocity is determined by the amount of force felt by this sensor. With some of the bottom-of-the-barrel keyboards, it can be very difficult to play softer notes on time. Very cheap and lightweight velocity-sensing keys tend to register toward the higher velocity values (90-127), because even a small amount of force still causes the key to move relatively quickly. The pressed position is usually 1/2 to 3/4 through the full travel of the key.
Synth-action and semi-weighted keys calculate the velocity by how quickly the key moves from its unpressed to its pressed position. There is a sensor that is designed to detect pressure. Pads calculate the velocity based on how much force comes down on the pad. Pads don't move (well, some move a tiny, tiny bit) and keys do. The method of determining the note's velocity.