MIDI stands for Musical Instrument Digital Interface. Put simply, a MIDI controller is used to digitally control a piece of software in real time using physical knobs and buttons. There are many different shapes and sizes with myriad different controls to choose from. Note that these devices are usually just MIDI signal generators and don't feature any samples or patches like a digital piano or keyboard would. They are used solely for software control purposes.
The most common type of studio MIDI controller is the MIDI keyboard controller, which is used to input musical notes into a MIDI track in a DAW recording session on the fly while the song is playing (or step by step if the recording program allows for it).
Another common MIDI controller is the DAW MIDI control interface, which consists of knobs, sliders, buttons and sometimes a transport control section to play, stop record, etc. within the session.
And then there's the MIDI drum pad controller, which is similar to the keyboard controller in that it will input MIDI notes into your software, but its designed to be played percussively with the fingers to play in realistic percussive beats in real time.
There are also MIDI controllers that combine all 3 functions into an all in one MIDI controller and keyboard, allowing the user to play MIDI instruments, navigate a session, and adjust controls all from one interface.
All these different types can be connected (either via a USB cable or a 5-pin DIN MIDI cable) to your studio software and communicate with MIDI signals to perform various tasks. If the software allows for it, each button or knob or fader can be assigned to it's own unique control, be it a synth's cut off frequency, a track's mute or solo function or panning / volume control.