When the Old French-speaking Normans invaded England in 1066, they brought their system of nobility with them, with new Norman counts being installed in the place of Anglo-Saxon earls. However, unlike all the other titles where the Norman name was kept, the Anglo-Norman counts switched back to earl instead. Why? It’s not known for certain but here’s the most widely accepted reason:
The word count comes from Old French comte, which at the time, would’ve been pronounced /kũtə/ and so was borrowed into Middle English as counte /kuːnt(ə)/. Unfortunately for the Normans though, it’s very difficult to get the people you’re subjugating to take their new overlords seriously when they call themselves something so similar to cunt /kunt/.
Basically, it’s like the are you live in was occupied by foreign invaders, and the first official statement you heard from them was “In accordance with the ways of my people, I, the Grand Gowtfakker will be your new ruler.”
Anyway, while the title of count itself was left unused in favour of earl, derivatives of the term like county and viscount still carried into English. The feminine form of earl in English nobility is in fact countess, showing that it really was just the word count that they were uncomfortable with.
Over time, pronunciation of both words has drifted with count becoming /kaʊnt/ through the Great Vowel Shift and cunt becoming /kʌnt/ through the FOOT-STRUT split. Nowadays, we’re perfectly happy to have a children’s show character called “Count von Count”.