German spelling has evolved over the centuries with influences of different regions and the church (whether it was Catholic or Evangelical). The orthography was influenced strongly by the Hapsburg Chancery, probably due the importance of the Hapsburgs as Holy Roman Emperors.
There have been a number for formal revisions in German orthography, the latest in 1996, the implementation of which spanned numerous years.
The French had an impact as well in the C vs K “issue.” The letter C having two sounds (“soft” like s or “hard” like k). A view was that this was an unnecessary complication, hence the hard c became k.
A further complication, in records from the Austrian Empire I have seen the name Karl/Carl written as Čarl (note the diacritical mark).
(English, which is a Germanic language, has some other issues, where the words “Celt” or “Celtic” normally pronounced with a soft c are sometime pronounced with a hard c [as in Kelt] with no change in spelling. And,then there are Italian loan words where the c is pronounced as “ch,” as in cello [with no change in spelling].)
All of this is coupled with a lack of standardized spelling in times past, and many people simply not knowing how to spell as evidenced by the same name/word being spelled multiple ways in the same document.
This then reminds me of the old adage, “In genealogy spelling doesn’t count.”