In MIDI, there are two types of recording procedure:
real-time resembling traditional recording - as with a tape recorder
step-time sequential recording, note-by-note, chord-by-chord

I have found that step-time has less latency issues than real-time.
With real time it seems that you can be done with something in the piano roll, and end up waiting a second or two for the software to catch up.
With step-time each note is directly written, with the keys hit, hence little to no latency.
I use a step-time control on my keyboard output. It seems to work the best with my setup.
Some keyboards don't have the elaborate midi controls, so not everyone has a choice of which to use.
Most usb keyboards use step-time by default.