(I'm a linguist.) Because phonetically the "j" sound in English like in the word "jeans" is not one sound, but rather two sounds together, the first of which is phonetically the pure "d" sound said very quickly. So, in the word "fridge", the "g" is representing the second part of the "j" sound, which is an affricative: https://en.wikipedia.org/wiki/Voiced_postalveolar_affricate