Why does a fan need capacitor? Capacitor is just providing charges to fan but it can be accomplished without it by directly connecting fan with electric supply. Which other appliances need capacitor?
A capacitor is often used for "decoupling".
The wires into any electrical appliance have inductance (because they are long and thin). This means that if there is a sudden increased demand in current, there will be a significant voltage drop. A capacitor can act as a "tiny battery" that briefly supplies this current while the main supply catches up. A fan often has a brushed motor which leads to spikes in current, and you want to smooth these out to prevent interference.
Just as the capacitor provides some local "peak current", it also prevents sudden spikes in current demand on the main supply, and in so doing it prevents the fan from becoming a noise generator on the mains. Very often you will see a capacitor used in conjunction with a choke - an inline inductor that helps prevent noise from being radiated by the appliance. Such a choke limits changes in current - and makes it even more necessary for the appliance to have some decoupling.
High speed electronics invariably have to have some local decoupling because at speeds of a GHz even a few cm of circuit board trace represents significant inductance.
Many fan motors are single phase, permanent split capacitor (PSC) induction motors. Single phase motors inherently have no starting torque and to get around this problem, engineers often "trick" the motor into thinking it is being supplied by 2 phases instead of one. This is done by adding a second set of windings to the motor that are physically offset to the main winding. This second winding also needs to be electrically offset (that is, it needs phase shift) from the main winding. There have been many techniques to do this, but the PSC induction motor uses a capacitor to cause the phase shift.
There is another reason for capacitors in electronics (but probably not fans) and that is Power Factor Correction