Fan meaning "an appliance for cooling" and fan meaning "someone who’s enthusiastic about something" are homonymous. They’re pronounced and even spelled the same, but have different meanings and origins. Same spelling isn’t a necessary feature — horse and hoarse are also homonymous.
Homonymous words cause some people a lot of confusion in English, as there seem to be so many of them. You can probably come up with a long list right out of your head without even looking online. They’re great for making puns, though! Homonymous is the adjective corresponding to the noun homonym: "a word with the same sound but different meaning." Usually the category is limited to words that also have different origins. The Greek roots to notice here are homo-, meaning "same," and onyma, "name."