If you put an Italian noun or adjective ending in 'co' or 'go' into the plural, you need to add an 'h' to preserve the hard sound of the consonant.
So 'il porco' becomes 'i porchi', for example.
In Italian, the consonants 'g' and 'c' change from a hard sound ( like the English 'g' or 'k') into a soft sound (like the English 'j' or 'ch') when they appear before the vowels 'i' and 'e'. To stop this change happening, you have to insert an 'h' as a kind of buffer to keep the consonants away from the 'i' or the 'e'.
If the consonant sound in the singular form is already soft, there is no need to add an 'h'. For example, 'il dolce' --> i dolci.