How does a computer distinguish two separate transmissions on a wire
On a wire you encode bits by changing the voltage, for example +5V could mean 1 and -5V could mean 0. If you do this naively you get problems with long sequences of 1's or 0's. For example you mentioned clock drift, i.e. when do I know that one 1 ended and the next 1 starts? But it's also problematic to have one voltage for a long time, because charge could build up at one end that needs to be dissipated somewhere.

So instead of using a naive encoding, we use a trick. For each bit we use two clock cycles, and encode the bit as the change in voltage. This way we implicitely also transmit our clock down the wire, the receiver can synchronise their clock using the same edge detection algorithm that they use to read the bits. This scheme is called Manchester code.

If you use more voltage levels to encode multiple bits at a time, the same basic idea can be applied. Instead of encoding the bits naively, we ensure that there is enough change in the data so that we can keep the clocks synchronised and the voltage on average 0. Check the related articles in the Wikipedia, for example 8b/10b encoding.