TIL about False cognates, pairs of words [with] similar sounds and meaning, but different etymologies; "For example, the English word dog and the Mbabaram word dog"
The image is simplifying it, but Italian borrowed the word from another Romance language, called Venetian. Latin sclauus /'skla.wus/ "slave, serf, servant" → Venetian scia(v)o /'stʃa(v)o/ "slave"→"bye". Then Italian borrowed it from Venetian, and it ended as ciao /tʃao/ because Italian hates that /stʃ/ cluster.
The meaning evolved this way because of mediaeval humility expressions, like "mi so' sciavo vostro". It means literally "I'm your servant", and it implies that I'm eager to fulfil some request that you might have.
A similar expression pops up in Southern German; see servus.