The early electronic computer was fitted with a panel of light bulbs where the state of each particular bulb would indicate the on/off state of particular register bits inside the computer. This allowed the engineers to operate the computer to monitor the internal state of the machine, so this panel of lights came to be known as the 'monitor'. As early monitors were only capable of displaying a very limited amount of information and were very transient, they were rarely considered for program output. Instead, a line printer was the primary output device, while the monitor was limited to keeping track of the program's operation.
As technology developed engineers realized that the output of a CRT display was more flexible than a panel of light bulbs and eventually, by giving control of what was displayed in the program itself, the monitor itself became a powerful output device in its own right.
Computer monitors were formerly known as visual display units (VDU), but this term had mostly fallen out of use by the 1990s.