@Anke my guess would be that they used to have different vowel sounds. Hardness and softness of g's and c's is generally to do with the following vowel but sometimes a vowel slips (English vowels are incredibly unstable) but the consonent doesn't follow.