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 electronic 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

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. 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.