As pointed out [in the Emacs manual](https://www.gnu.org/software/emacs/manual/html_node/emacs/Mouse-Avoidance.html), by default “Emacs hides the mouse pointer each time you type **a self-inserting character**” (emphasis mine).

If hiding only on self-inserting characters is not enough, customize `mouse-avoidance-mode` and set it to `banish`, which will force the mouse pointer to a corner of the frame on *any* keystroke.