Closed captioning for a live broadcast is very similar to court reporting -- stenocaptioners use a special keyboard to write what they hear as they hear it. Stenocaptioners are often capable of writing at speeds of up to 250 words a minute -- much faster than even the fastest typists.
The typed words then go into a computer system, where they are translated into text and commands. Captioning software then converts the text into the captions which are then sent to a caption encoder. The results are what you see on the television screen, typos and all.