Prefixes in Slavic languages originated from the prepositions merged with the roots.
The old Slavic prepositions надъ
, подъ
etc. which ended with ъ
, were merged before the fall of the reduced vowels so the vowel was kept, and you can still see it on its historical place before the roots starting with a yotized vowel: объятие.
When the reduced vowels fell, prononciation changed to agree the articulation of now adjacent consonants, but orthography did not reflect it. The words подътвердити, отъдавити (ъ
was read as a really short ы
) became подтвердить, отдавить etc, with impossible combinations of a voiced and voiceless consonant. The both consontants are now voiced or not according to the last one ([поттвердить], [оддавить]) but written the old way.
The prepositions ending in -с
and -з
(раз
, из
etc.), however, did not end with a vowel. The orthography reflected it from the beginning.
But the prefix с-
originated from the preposition cѫ
which never ended in -с
. It ended with ѫ
. This nasal sound after denasalization of the yuses had changed into y
in nouns like сумерки
, сутки
and into ъ
(which later fell) in verbs, and undergone the process described earlier. So this prefix does not change in writing, just as the prefixes not ending with -c/з
don't.
The prepositions без
and через
(and the Church Slavonic borrowing чрез
) merged much later than the others, so until the orthography reform of 1918, they were always written без-
, чрез-
and через-
.
з
inздоровье
was a prefixсъ-
of another origin, not related tocѫ
and meaning "good". Proto-Slavic*съдорвъ
literally meant "of good wood",*съмьрть
— "good (natural) death".