The English/Latin alphabet is originally based off of the Phoenician alphabet, as is Greek, Arabic and Hebrew. The Greek alphabet begins ABGDEZΘ and the Hebrew alphabet begins with (A)BGDHWZ without the Dagesh, which is a later innovation to reduce ambiguity, and the Arabic alphabet begins with (A)BJDHWZ but the Latin alphabet begins with ABCDEFG. In Latin/English, F is the 6th letter while its corresponding letters are ordered at #17 in Arabic, #17 in Hebrew (again, not counting the Dagesh), and #21 in Greek. G is the 7th in Latin/English while its equivalent is #3 in Arabic Hebrew and Greek. Why does the English/Latin alphabet have such an unusual word order compared to its cousins in the Eastern Mediterranean?
The order of the alphabet has remained remarkably stable. Where the Latin alphabet order diverges from Greek and Arabic is due to a history of mergers, changes, disappearances of sounds and their relation to the letters.
The Latin, Greek, Arabic and Hebrew scripts are descended from the Phoenician abjad. (An abjad is a script that distinguishes consonants and not vowels. Semitic languages like Phoenician, Arabic, and Hebrew are suited to abjads because a word's meaning can be inferred through consonants only. The Greek language does need vowels to tell apart words. The Greeks used Phoenician consonants that they did not need and repurposed them as vowels.)
The first seven letters in the Phoenician abjad are:
The Greeks did not have a glottal stop in their sound inventory, and they had no need for the first consonant. They transformed the first and fifth letter sounds into vowel, alpha Α /a/ and epsilon Ε /e/. Some variants of Greek had /w/ and /h/ but others did not. In Classical times eta became a vowel exclusively and digamma fell away.
Latin script descends from a Greek script variant, the Euboean Alphabet. The Euboean Alphabet kept digamma /w/ and heta /h/. An early Italic script used gamma for both /k/ and /g/. Early Latin used the letter C for both /k/ and /g/. The letter G was a later innovation to tell these two sounds apart - you can still see that G is a marked form of C. It seems a historical accident that C became /k/ and G became /g/. The letter G replaced the letter Z in the alphabet position, as Latin did not use the sounds /z/. Theta also died out as /θ/ did not exist in the Latin language. Later on when the Romans became large consumers of Greek culture, they added Y and Z back onto the end of the alphabet. Lastly, the Romans used Greek digamma to represent /f/ because /f/ and /w/ have similar mouth placement (places of articulation).
Thus we have:
Phoenician did not have the sound /f/. Descendent scripts have used multiple ways to sound it out. Latin used the sixth Phoenician letter, as /w/ and /f/ have similar places of articulation. The sixth Phoenician letter wāw /w/ became Latin F /f/, old Greek digamma Ϝ (representing /w/), Hebrew vav ו ( and Arabic wāw و. In this respect, the Latin alphabet preserved a letter that the Greek alphabet lost.
In modern Greek, /f/ is represented by phi Φ. This letter is of unknown origin and seems to be created newly by the Greeks to represent aspirated bilabial plosive /pʰ/ (Ancient Greek didn't use the sound /f/). Over time, all the aspirated consonants of Greek became fricatives and this sound became /f/.
Meanwhile in Hebrew and Arabic, Hebrew pe פ and Arabic fa ف represent the /f/ sound. The Hebrew pe can be used for "hard pe" /p/ or "soft pe" /f/. In Arabic, a prior sound change transformed /p/ became /f/. Phoenician pē became Hebrew pe פ, Arabic fa ف, Greek pi π, and Latin P.
The Latin letter C is the same origin as the Greek gamma, the Hebrew gimel ג, and Arabic gim ج. The third letter in all these scripts have the same origin where the sound was /g/. In early Italic scripts the letter C represented both /g/ and /k/, which have the same place of articulation. The Romans then created the letter G by adding a mark to letter C these into two sounds: letter C for /k/ and letter G for /g/. The Romans did not have the sound /z/ and replaced letter Z with letter G. In classical Arabic the sound changed to be /d͡ʒ/ (like first sound of judge), but some modern variants now pronounce this letter as /g/.
So the third Phoenician letter became a sound for /k/ in Latin; /g/ in Greek and Hebrew; and /d͡ʒ/ in Arabic.
Further reading: