Some of this was a top-down overhaul of the writing system in the 19th century. Before that it was an awful mess and people just "vibe-wrote" the weird Slavic sounds using latin how they saw fit; try reading some old writings from that era. Or read some modern Polish or Czech text :-D