The Slavic second palatalization is a Proto-Slavic sound change that manifested as a regressive palatalization of inherited Balto-Slavic velar consonants that occurred after the first and before the third Slavic palatalizations.
The second palatalization of velars is a direct consequence of the monophthongization of diphthongs, or more precisely, the change *aj > ē. While *kaj, *gaj and *xaj were in accordance with the principle of so-called intrasyllabic synharmony that operated during the Common Slavic period, the resulting *kē, *gē, and *xē defied the intrasyllabic synharmony since the velars ended up in front of the resulting front vowel ē, which defied Proto-Slavic phonotactical constraints.
This anomaly was resolved by palatalizing the velars, just as it was done during the first palatalization. However, the results of the second palatalization were different and not completely uniform across Slavic territory, indicating one of the first dialectal differences. Usually, this palatalization is described as gradual, with fronting to proper palatals occurring first and then (perhaps with those that were affected with the third palatalization) assibilation. Hence it is sometimes called sibilantization.
In addition, the same process operated before the new instances of *i deriving from *oj.
The inherited velars *k (< PIE *k, *kʷ) and *g (< PIE *g, *gʰ, *gʷ, *gʷʰ) change before the Proto-Slavic diphthong *aj/āj (< PIE *oy, *h₂ey/ay), which itself must have become *ē by the time the second palatalization started to occur:
Proto-Slavic velar fricative *x that was absent in PIE, and which arose primarily from PIE *s by means of RUKI law, from word-initial PIE #sk- as well as from Germanic and Iranian borrowings, changed in the same environment as:
Ultimate output of the third palatalization is thus the same as that of the preceding second palatalization. The difference of the palatalization of *x is dependent upon chronology and the Slavic dialect in question: In East and South Slavic it's /s/, and in West Slavic languages it's /š/. Slovak tends to go with South Slavic in such instances, e.g. Čech "Czech", plural Česi "Czechs".
The intermediary /dz/ has been preserved only in the oldest Old Church Slavonic canon monuments, Lechitic languages, Slovak and the Ohrid dialects of Macedonian. Other Slavic languages have younger /z/.
Second palatalization alternates s consonant clusters specifically
In South Slavic languages the second palatalization operates even if medial *w (> OCS v) is present between the velar and the diphthong (or its reflex), whereas in West Slavic languages the original *kvě/gvě clusters are preserved. Although words with groups cv, zv resulting from the second palatalization are found in East Slavic languages, they are likely to be a consequence of the Church Slavonic influence, since there is evidence of preservation of original groups in Ukrainian and Belarusian languages and in Russian dialects. Compare:
In natively coined and inherited Slavic words, the second palatalization occurs only before the new *ě < *aj because the first palatalization already operated before all the other front vowels, but in loanwords, it operates before all front vowels. Compare:
The second palatalization probably spread from the south of the Slavic speech area; it started to operate sometime between the end of the sixth and the middle of the seventh century AD, and the environments where it operated vary. In Russian, Slovak and (in nouns) Slovene, the results of the second palatalization were later removed at morpheme boundaries (i.e. before inflectional endings) due to paradigmatic leveling by analogy. In Ukrainian and Belarusian, however, the effects of second palatalization are still evident in such cases.
For Northwest Russian varieties (Novgorod, Pskov), according to Zaliznyak, the second palatalization did not take place at all (E.g. Pskovian kev' : OESl. cěvь: Old Novgorod *kělъ : OCS cělъ). According to others, however, such apparent unchanged velars were actually palatalized dentals both in the older monuments and in the modern varieties (so such #k- would in fact be [t']). So the only exception with these varieties would be the non-occurrence of the affrication normally brought on by the second palatalization.