An ubiquitous friendly and familiar salutation
Everywhere and every time in Italy, in family, at school, in the gym, in the hospital, at any meeting, at religious services, no matter if people know each other, you will hear hundreds, thousands of times reiterated, the same magic word: ciao, and the cacophonous cia-ciao.
Babies are learned by their parents to say ciao as the first greeting word: fa’ ciao, di’ ciao, sa già dire/fare ciao.
If you reply to ciao with buon giorno o buona sera, people remain speechless, and as such they avoid to greet you next time.
After having ordered two espressos, I replied buon giorno to ciao of a new and young bartender. Waiting for coffee, I cleaned a grease stain on the edge of the bench with a paper serviette. I told the bartender grazie when he placed coffee cups on their saucers. No polite reply: ... he just escaped.
Few of them, sure of their freedom of speech, endure with ciao.
Traditional and appropriate verbal forms of greeting are on the way of becoming obsolete: buon giorno, buon pomeriggio, buona sera, buona notte, arrivederci/la, addio, di nuovo/nuovamente, felice d’incontrarti/la, felice d’averti/la incontrato/a, a domani, a presto, benvenuto/a, ben tornato/a, … Salve seems to be employed by polite people to avoid at the same time ciao and traditional forms of greeting.
Indeed, which would be the need of modulating the verbal form of greeting in time and circumstances? Are we unequal and not brothers? Did French revolutionaries and their epigones not preach ‘Liberté, ègalité, fraternité’ among humankind? Alas, history tells that they liked to eradicate inequalities by guillotine, an up to date beheading machine; but … they were just compelled to do so by ephemeral necessities . Does this web site not claim that Pluralitas non est ponenda sine necessitate?
s-ciao, the precursor
So, how this small word, recalling many derogative Italian words (ciabatta, ciacciare, ciacola, cialtrone, ciampicare, ciana, ciancia, cianfrugliare, ciangottare, ciantella, ciarla, ciarpa), rose to become a verbal symbol and seal of ‘human equality and brotherhood’? The history is rather illuminating and foretelling.
Scholars have found the origin in the Venetian word s-ciao, s-ciavo, meaning ‘slave’, from Medieval Latin sclavus, slavus, in turn from Byzantine Greek Σκλαβος, meaning ‘Slav, Slavic/Slavonic people’. The term ‘slav’ has been related to the Proto-Indo-European root *klew-, meaning ‘fame, glory’, like the Ancient Greek κλεος (glory), which may explain the insertion of κ between σ and λ. The term Σκλαβος for Slav appears for the first time in the History of Wars by the Byzantin scholar Procopius (VI century). The contemporary Latin writer Jordanes referred Slavs as Sclaveni. The change from the people name Sclavus into the pejorative meaning of ‘slave’ (Latin servus) seems to have occurred in Germany between the X and XI century , following the Slavic wars between the Holy Roman Empire, ruled by German kings, like Otto the Great, and Slavic tribes, which, having being subdued, provided slaves to Germany and the Mediterranean world. The tendency to confuse Slavic people with slaves may have been exacerbated by the contempt of Slavic people as barbarian populations .
Coming back to Venetian s-ciao, the pair s-c cannot be pronounced as the Italian sc (English sh) like in scena, but separating s from c, which explain the subsequent apheresis (drop) of s and testifies that s-ciao is not an Italian, but just a Venetian word.
I recall that my father, living after the II World War in the North-East Piedmont (the region of the lakes north of Novara), employed the word s-ciao as a conclusive exclamation, meaning pazienza! (never mind! in English, but pazienza! implies submission), like to affirm an unacceptable, but unavoidable condition.
You can find a similar meaning in the poems of C. Porta, writing in Milanese Dialect :
Olter disgrazzi de Giovannin Bongee ... 417 S’ciavo, pascienza per i pover mort! ...
It seems attested that s-ciao was in Venice a submissive and obsequious (hence fawning) greeting. Among Internet documents citing the Venetian word s-cia(v)o, I found, with the help of , a XIX century Dictionary of the Venetian dialect  and a XIX century Dictionary of the Trieste’s Dialect . In the former you can find s-ciao, written schiao, both as an intimate greeting and a conclusive exclamation, but of submissive/negative character.
SCHIAO, sincopato di Schiavo, Schiavo, Modo di salutare altrui con molta confidenza; corrisponde all'Addio, ...omissis... E SCHIAO; ovv. SCHIAO SIORI o SCHIAO SOO, A Dio riveggo, A babbo riveggoli, Indica una cosa di cui non si vede il fine - Abbiam fritto; Addio fave; Buona notte pagliericcio, che i Latini dicevano Actum est, Modo di dire che significa, Noi siam perduti, Non v'è più speranza -
In the latter you can find both the greeting form s-ciao and the form s-ciavo meaning both slave and Slav.
s-ciao, (s-cìaó) specie di avverbio, che è modo di salutare altrui: addio, salve. ... s-ciavo, agg.e sm. (s-ciavo) schiavo; slavo: s-ciavo duro, met. battezzato con l’agresto (a sourish seasoning from grapes); esser s-ciavo, met. (metaphorically) non poter disporre; essere schiavo. s-ciavon, sm. (s-ciavon) greco scismatico; met. croio (tough?), incivile, rozzo, zotticone; mandar far benedir del prete dei s-ciavoni, met. mandare in quel paese — e simili, ma più c’altro è modo di amorevole rimprovero. s-ciavuncolo, agg. e sm. (s-ciavuncolo) slavo — la voce del dialetto racchiude in sè qualche cosa d’ironico e un tal po’ di disprezzo.
In two comedies of the XVIII century Venetian author C. Goldoni you can find the Italian version of the greeting.
La Locandiera (The Mistress of the Inn): the haughty Baron Ripafratta greets two supposed friends: 'Amici, vi sono schiavo' (Friends, I'm your slave). La Dama Prudente (The Prudent Lady): the couple of cicisbei (gallants) of Donna Eularia (the prudent Lady), Marquis Ernesto and Count Astolfo, as well as her husband Don Roberto, greet each other, four times, in the same way: 'Amici(o), vi sono schiavo' (Friend(s), I'm your slave).
It looked appropriate in the XVIII century Venice, and other Italian cities, to hear a cicisbeo (cavalier servente, literally ‘serving cavalier’) greeting with the submissive expression s-ciao, as he was an educated gentleman (‘cavalier’) with the duty and privilege of accompanying and protecting (‘serving’) an upper-class woman married to someone else, implying submission to his mistress will.
How and when the Milanese ciao spread to Italy
Separation of the familiar ciao from the submissive s-ciao likely occurred in Lombardy, around Milan , in the late XVIII century and the early XIX century. A curious witness can be found in the work Italy published in 1821 by Lady Morgan (1781-1859), an Irish novelist:
From the French translation  Ciavo (prononcè tchaou avec la v en voyelle ou á peine articulé) est la salutation la plus familière e la plus amicale des Milanais.
Lady Morgan, a liberal writer against the Restoration in Europe promoted by the Congress of Vienna (1815), while visiting Milan, then under the Austro-Hungarian Empire, certainly attended upper-class milieus willing to manifest liberal costumes and dreams by an informal salutation, too . This reference confirms that word etymology should be guided by their context and social milieu.
Since then up to the II World War, the Milanese Ciao remained confined in Northern Italy, above Po river, mainly in the area influenced by Milan, as a dialectal form of greeting.
From the 1901 dictionary of U. Avogadri : 'Ciao – bruttissima e inutile sostituzione dialettale al più bello, più italiano e più poetico ADDIO',
 A. Lukaszwicz, De sclavinis et sclavis…, Dialogues d’histoire ancienne, Vol. 24, No. 2, 1998, pp. 129.135.
 E. Kosovitz, Dizionario Vocabolario del Dialetto Triestino e della Lingua Italiana, Tip. Figli di C. Amati, Trieste, 1890, from https://it.wikisource.org/wiki/Dizionario_-_Vocabolario_del_dialetto_triestino/S.
 G. Boerio, Dizionario del Dialetto Veneziano, Terza ed., Reale Tip. di G. Cecchini Edit., Venezia, 1856, from https://archive.org/details/dizionariodeldi00boergoog/page/n6.
 M. Fanfani, Ciao e il problema della datazione, Lingua Nostra, Vol. 1-2, 2012, pp.7-18.
 C. Porta, Olter desgrazzi de Gioannin Bongee, from https://it.wikisource.org/wiki/Poesie_(Porta)
 Lady Morgan, L’Italie, Traduit de l’Anglais, Tome premier, A. Wahlen et C.ie, Bruzelles, 1821.
 Encyclopaedia Britannica, Reign of terror, from https://www.britannica.com/event/Reign-of-Terror.
 U. Avogadri, Forme e voci dialettali più comunemente usate dai ferraresi nella lingua italiana, Stab. Tip. ditta G. Bresciani, Ferrara, 1901.