I've been wondering about the peculiarity that the letters C and G have different sounds depending on what comes next in pretty much every language using this alphabet, and why the only two consonants for which that's the case also happen to be descended from the same original letter. I found that I can only trace the answers as far back as a few centuries BC. At that point, we're only talking about what these letters now represent before A, O, U, or a consonant: a stop with the back of the tongue touching the back of the roof of the mouth, just vocal in G's case and not in C's case. That is the original sound in both cases, with the various sounds they now represent before E or I in different languages being derived later by letting the tongue slip forward as if in anticipation of the vowel.
The Romans had inherited the Greeks' gamma and kappa, although the way they drew gamma by this time looked like "C". No letter that looked like "G" existed yet, its sound is what the letter that looks like "C" represented. But the use of K was already getting less common or even essentially ended at that time, and its sound was left to be represented by C, even though it already had another sound to represent (the vocal counterpart to K's non-vocal sound). That makes sense if they didn't really think of them as two different sounds, like the famous L/R unity in Oriental phonetics and the trouble European languages' speakers often have with languages that distinguish between aspirated and non-aspirated stops. But it's clear that the Romans did have what they considered to be two different sounds, because they felt compelled to add another letter just to separate them again, which is why the G got invented: to take over the written representation of C's original sound because K's sound had invaded and taken over so much of the written use of the letter C.
So, G was the solution to the problem of C being stuck with two different sounds and no other written way to distinguish between them. But why create the problem in the first place? They already had two letters for those two sounds! All they needed to do was keep using both of them, as they already always had until then...