Network components are a bit confusing. Partly because what is commonly called a router is usually a router, switch, and modem all in one box.
A modem is something that converts DSL, fiber, or cable signals to Ethernet.
A router sends network traffic between different networks. For example, between your wired LAN and Wifi, or between your LAN and the internet.
A switch sends network traffic only to its intended recipient. That is why they are used a lot. If two devices are connected to a switch, all their communication is transmitted only to themselves. The communication only leaves the switch if they need to talk to something that is not on it (like a WiFi device, something connected to the WiFi router, or the internet)
A hub looks like a switch, but is simpler in that it broadcasts the network traffic to all devices connected to it rather than just the intended target. For this reason they are only suitable for small networks.
So what is commonly called a WiFi Router may or may not have a modem in it. It has a router that directs traffic between the LAN, WAN, and WiFi. And it usually has a switch or hub in it for the wired ports. It also usually has a firewall, DNS, DHCP, and QoS built into it. All of which could be done by separate devices.
I apologize if my description is not 100%. I am attempting to simplify for anyone reading that is not overly technical.