It's a shortened form of "schiavo", meaning "slave" in Venetian. Originally, it was used as a playful greeting, implying that the speaker was the other person's "slave" to their service or friendship. Over time, it evolved into a casual greeting and farewell in Italian, and eventually spread to other languages.