Modern, next-gen firewalls provide a far greater level of security and can include a number of systems that help protect the network. This includes deep packet inspection, website filtering, antivirus inspection, TLS/SSL encrypted traffic inspection, and third-party management integration.
As such, then its easy to see how these three different components work together. While the switch manages data being transferred across the network, it also ensures that information is sent to the right place. This guarantees that no data is sent to the wrong system while still providing the bridge for your network to operate effectively. Of course, this only manages the internal network. To connect to the internet, you need a router system, connecting to other networks and allowing you to transfer data packets.
More info: what does it stand for in computers