A MIDI keyboard is a musical device often used with music production software (DAW) via a USB connection to play various virtual instrument plug-ins (e.g., AAXs, VSTs, AUs, etc.) or trigger drum samples.

Note: A MIDI keyboard does not produce sound but sends messages to a music production program (DAW).

The messages sent by a MIDI keyboard are then interpreted to what key you have pressed, including articulations like pressure (also known as MIDI aftertouch).

For example, if you press middle C on a MIDI keyboard, consequently a Digital Audio Workstation will take notice of that and will either record the MIDI notes on a piano roll or make a virtual instrument generate a sound playing at middle C only (i.e., if your DAW isn't set to MIDI recording mode).
Top