so why do some have fans
As in cooling?
Switches generate a ton of heat in the ports' copper wires, especially gigabit+ and PoE. Higher-grade consumer and industrial (think Cisco) switches also have powerful hardware because they do a lot more than packet switching -- they handle QoS, VLANs, and ACL-based filtering, as well as gigabit or faster connections on all ports.