Here are all the places I know of between pressing a key and hearing the sound where latency is likely to be introduced:
- Your MIDI interface: This might be built into your keyboard or it might be another device with a female DIN jack on it. Some of these are less latent than others, but the variation is usually pretty small. However, a lot of these work over...
- USB: USB generally introduces a nonzero amount of latency. It's usually not much though, unless your USB bus is flooded with data. Firewire has this problem as well, although IMHO to a much smaller extent.
- Audio buffers: Processing digital audio involves sampling a short amount of it and then processing those samples. Your plugins all do this, as do parts of your environment (Cubase, in your case). Again, it's pretty short and not likely to be noticed, unless you have a plugin that needs a particularly large buffer. Most of those will have a setting, like you found in Kontakt, for the length of the buffer. Smaller buffer, less latency.
- Output buffer: This is the big buffer that stores the output of your audio software on its way to your soundcard, and is the source of most latency problems. This is the one that is managed by ASIO drivers on Windows, and Core Audio on OSX. This buffer tends to be larger, because it's insurance against pops and clicks that can occur when audio software has to compete for system resources. The bigger the buffer, the longer you can wait before having to calculate some more samples.
- Driver/hardware: Some audio hardware (or drivers) can include their own internal latency. This is not easily detectible since it doesn't have to be reported to the OS, like the output buffer does.
50 ms is a lot of latency in this kind of situation. You have said that Asio4All reports 13ms of latency, which is troublesome but not unusable. And it may be correct: that output buffer may well be 13ms long. But what about Kontakt's buffer? If that plugin has its own internal delay, then that'll be added to whatever Asio4All is working with. Most modern computers, unless they're bogged down with background processes, ought to be able to get under 15-20ms without too much trouble.
In general, the trick is to figure out the minimum latency you can work with without running out of buffer under load, which will sound like popping and glitches. Your limitations are the free resources in your system: available CPU, RAM, and I/O. Your integrated soundcard is probably fine latencywise, so long as it plays nicely with Asio4All. It might not. Try playing back basic audio recordings in a program like Cubase, using no plugins, and see what the latency feels like - this will eliminate Kontakt from the equation. How long after you press play is it until you hear sound? Maybe play along with a simple softsynth such as Synth1 that isn't processing anything terribly complicated (turn the effects off).
As an aside, it's a good idea to look for things that might be intermittently ruining your audio stream, and get rid of them. On my Macbook Pro, which is plenty powerful for audio, I still get audio dropouts when the wireless finds a new network. When working with audio, I generally turn wifi and bluetooth off.
As for your second question about offsets in recording, the recording environment does know the ASIO buffer size and many of them have an automatic compensation feature. However, it generally does not know the delay due to your audio drivers, nor due to your MIDI interface. Some software (I know Ableton Live has this, not sure about Cubase) allows you to specify the amount of latency above the ASIO buffer if you happen to know it or can measure it, and it will compensate your recordings based on whatever you put in.