MIDI is simply data that tells a sound generating device what note to play, how long to play it and with what parameters. It's up to that sound generating device to do the job of actually producing the sound in response to those commands. The actual sound you get depends entirely on the quality of the sound generating device - be that your external keyboard or your VST inside of Sonar.