Okay, here's a silly explanation.
Imagine two people want to communicate. They shall be named Alice and Bob. It's night, and they're too far away to hear each other; but each has an electric torch, and they can see the light coming off the other person's torch.
Those torches are fancy. They have two settings: "strong" (big arse blinding light) and "weak" (wee light, but still visible). Let's call a strong flash "1" and a weak flash "0" for short.
They also have a code, that they use to interpret the flashes of light that they send each other. Here it is; check the "binary" column. For example, if Alice sent Bob a weak flash, then a strong flash, then weak, strong, weak, weak, strong, strong, then Bob is supposed to interpret this as an "S".
This is already enough to communicate. Like this:
- Alice: 0000 0010 0100 1000 0110 1001 0010 0000 0100 0010 0110 1111 0110 0010 0000 0011
- Bob: 0000 0010 0101 0011 0111 0101 0111 0000 0011 1111 0000 0011
Remember, each "0" is a weak flash and each "1" is a strong flash. When we decode it with the table from the link, here's what you get:
- Alice: Hi Bob
- Bob: Sup?
Now. Messing around with the settings of a torchlight is slow, painful, and annoying. So is to watch closely for light flashes, write them down, and decode them with a table. So... let's use machines to do so?
- Encoder: a fancy machine with a built-in torch. You type "S" down that machine, and it outputs weak, strong, weak, strong, weak, weak, strong, strong flashes in this order.
- Decoder: another fancy machine. It has an optical sensor; if it gets the exact sequence of flashes from above, it'll output "S".
Okay, now let's replace the torch. We want something that emits light that you can see from as far as reasonably possible; like, from Mars if you want. We could instead use light that has been amplified by radiation, it's really strong and directed. The common name for that is "laser".