Why do batch files sometimes stall until you hit Enter?

Batch files will "stall" if you accidentally click-and-drag in the window, as if you are selecting text. It is roughly equivalent to pressing Ctrl+s.

Pressing enter or right-clicking your mouse will deselect the text and the console will carry on.

It happens more often if you click in the window to bring the console forwards while it is scrolling. If you simply Alt+Tab to the window or bring it forward by clicking the title bar then you will likely not see this behaviour.