basically what MIDI controllers/keyboards do is to let yourself create music in into your computer via USB/MIDI inputs, through a program such as garageband,ableton,logic,reason. So rather than create piano riffs through the programs own online piano, you d have to scroll through like c3 c4 c5 etc. but through a MIDI controller you can play and it directly records through the device. Dont be confused by all the slidcers and shit it all looks techincal but if you have musical knowledge such as being able to use a mixing desk it is all relavently simple.
there are many sorts of midi controlls, eg keyboard, beatpads, drum machines, syntherizers,