How does a network switch build its MAC address table, and how does it differ from a router's routing table?