When digital data transmission along wires (Morse code, Baudot telegraph machines for ex. ) had shown its usefulness also serious scientists became interested in it. Old systems based on relays did not gave much room for flashy on math based codings because the limiting factor was the mechanical speed of the parts of the equipment.
As electronics became available, at first along the vacuum tubes, higher transmission speeds became possible. It became gradually obvious, that the well established asynchronous transmission with marks and spaces (it's still popular in slow data rate applications) was far from optimal when one wanted to maximize the data rate through a given line and at the same time to keep the error probability below certain limit.
Mark-space -idea i.e. Voltage =ON for mark (or state 1) and voltage =OFF for space (or state 0) and and sending them sequentially as a fixed length pulses (like UART interfaces still do) do not give to the receiver especially good possibilities to decide was it a mark or space which is between the wires just now and when would it be the best moment to measure the voltage for valid decision. The causes:
- pulses tend to get stretched and rounded through their flight along the wires due the frequency dependent propagation speed and attenuation
- there's noise
- there's no common time reference for the transmitter and receiver, a kind of clock synchronization is needed before the clocks of on time based decisions drift too much apart. The practical timing signal should be a part of the data transmission signal.
To lift the available data rate through a given line higher smarter ways than at fixed rate sent DC levels were developed to present the digital states and to carry the timing information at the same time. Different methods were called line codes to separate them from modulations.
Modulations lifted the signal to a higher frequency band and especially radio communication needed it. I have in practice tried a telegraph machine which was based on about 90 years old technology and sent text at HF band. It really was a mechanical device which actually needed a DC mark-space signal, but the radio station had a frequency shift modulator and demodulator interface between the telegraph machine and the radio gear. Morse code was used to ask one to switch the telegraph ON. To do it a tuning fork was used to chek that the motors ran at the right speed.
Line codes occupied a band around 0Hz. Just 0Hz was not so optimal because it was difficult to pass the DC component, so a good line code did not suffer from the removal of the DC component. For original telegraphs DC was as important as some band above it.