One of the goals of learning touch typing is to type not looking at the keyboard. The on-screen keyboard helps you in achieving this.
The on-screen keyboard reflects the state of the actual keyboard.
It displays the current keyboard layout and the state of all the keys. There is no need to look at the actual keyboard—you see it on the screen.
Swiss-German keyboard. The right Shift is pressed.
Moreover, the labels on the keys of your actual keyboard may not represent the characters you get (e.g. when you switch to Spanish or Dvorak keyboard layout while using the US keyboard). Looking at the actual keyboard will not help in such cases. This is when the on-screen keyboard becomes invaluable.
The on-screen keyboard highlights the next key to press.
Another helpful feature of the on-screen keyboard is highlighting the next key to press. It even proposes to press the keys Shift, Caps Lock, and AltGr when necessary. It teaches you when and what key to press.
Spanish keyboard. The next key is the acute accent.
When it comes to entering non-obvious characters with diacritics (e.g. with accents), the on-screen keyboard shows the correct order of keys.
The on-screen keyboard also draws an arrow (a line) from the corresponding home key to the next key, which shows the proper movement of the finger. This is especially useful for beginners.
The on-screen keyboard shows the key you've actually pressed.
If you make a misprint, the on-screen keyboard highlights the key you've actually pressed. This allows you to find the next key literally by touch, looking only at the on-screen keyboard.
The key "b" is required, but the key "v" is actually pressed.
It also highlights the non-character keys like Ctrl, Alt, or Backspace when you press them.
Conclusion
There is no need to look at the actual keyboard anymore when you learn touch typing. Guided by the on-screen keyboard, you look only at the screen, find the keys by touch, and your touch typing skill grows quickly.