It was often done by trial and error since terminal manuals are of little or no help. If flow control doesn't work right or is not implemented, padding is one solution. Some of the options to the stty command involve padding. One cause of this is that the serial port's hardware buffer is quite small. Then the computer interrupts what it was doing and software checks to find out what happened.
Terminals also have serial ports and buffers similar to the computer.
Since the flow rate of bytes to the terminal is usually much greater than the flow in the reverse direction from the keyboard to the host computer, it's the terminal that is most likely to suffer overrunning. When its appears that the receiver is about to be overwhelmed by incoming bytes, it sends a signal to the sender to stop sending. Much less common is the opposite case where the PC can't keep up with your typing speed and tells the terminal to stop sending. Anything you type at a locked keyboard is ignored. The keyboard is not locked so that whatever you type goes to the computer.