This happened on my M1 MBP, and is now happening on my M2. It is really annoying. I see it mostly when I'm typing fairly fast. The jump is sometimes to the Home of the current page, and sometimes to some location a few lines above where I am typing. The exact location appears to be application dependent. My interpretation of it is that due to inadequate debouncing of the keyboard keys, sometimes a spurious control character is received, cause the jump. The other, equally annoying “jump” that it does is to switch to another Input Source. I have several of those enabled on my system for language-learning purposes, and so I might discover that I'm typing a few Cyrillic or Hiragana characters in the middle of the English text.
Update 1: I believe that I have figured out a solution in my case. I changed the trackpad click force setting from “Light" to "Medium". I think that as I typed, my hand was making light contact with the trackpad which sometimes registered as a click, in combination with whatever key(s) I was typing, causing the jumps. By increasing the force needed to register as a click, I think I've eliminated the spurious clicks and therefore the problem. It certainly seems to be behaving better now.
Update 2: OK, changing the trackpad click force setting isn't a complete fix, the problem can still occur, but much less often than when the setting is "Light". At least this suggests that the underlying problem is spurious trackpad clicks or other activity.