My question is related to the common ground in a UART communication. So far, what I understand how communication in general works is: Distinguishing the voltage between two cables (one is a GND and one is the data wire).
But if they have two different grounds and two different supply voltage like for example one device has 5V and the other device has 12V.
How can they create a common ground, for a stable data transmission??