line coding
You want to send the bits 1011 down a wire. The wire can only hold a voltage — high or low. How exactly should each bit become a voltage over time? That recipe is line coding: the agreed scheme that turns a stream of bits into the up-and-down pattern of a signal on the medium, and back again at the far end. The sender and receiver must use the same recipe, or one's high will be read as the other's nonsense.
The simplest scheme is NRZ (non-return-to-zero): hold a high voltage for a 1 and a low voltage for the whole bit-time of a 0. It is easy, but it has a sneaky problem: send a long run of identical bits — say 0000000 — and the voltage just sits flat, giving the receiver no edges to lock its clock onto, so it can lose count of how many 0s went by. Manchester encoding fixes this by putting a transition in the middle of every bit-time: a high-to-low mid-bit transition means one value, low-to-high means the other. Every single bit now carries an edge, so the receiver can recover the clock from the data itself — at the cost of needing twice the signal transitions (and so more bandwidth) for the same bit rate.
Line coding is a baseband technique — it shapes the digital signal directly, with no carrier wave (contrast modulation, which rides bits on a carrier). A good line code balances several wants: enough transitions to keep sender and receiver clocks in sync, no long-term DC bias (which transformers and capacitors in the path cannot pass), efficient use of bandwidth, and sometimes built-in error checking. Classic Ethernet used Manchester for exactly its self-clocking property; modern high-speed links use cleverer codes (like 4B/5B or 64B/66B) that guarantee frequent transitions without doubling the bandwidth.
Encoding 1011 in simple NRZ gives high-low-high-high — a flat stretch the receiver could miscount on long runs. In Manchester, each bit becomes a mid-bit edge (e.g. low-to-high for 1, high-to-low for 0), so even 0000000 produces a steady train of edges to clock on.
Self-clocking codes like Manchester trade bandwidth for guaranteed transitions to sync the clock.
Line coding is not encryption and not error correction — it is just a bit-to-signal mapping. Anyone who knows the scheme (which is public) can decode the signal back to the original bits.