A router's primary function is to manage the interface between two or more different sub-nets. Home routers tend to be very specialised with a number of specific extra features, which are required for the domestic environment. These include a DHCP server, a firewall, and a Network Address Translation (NAT) function. They may also include an integrated modem, a switch function and wireless networking. For a home router, one of the sub-nets is the Internet itself.
The DHCP server provides a mechanism for attached computers, phones, tablets, games consoles, etc to be provided with the addresses they need (their own IP address, the gateway address and the DNS server address).
The firewall guards against various types of attack from the Internet.
The NAT function allows a number of computers on the private network to share a single public IP address on the Internet.
The integrated modem allows a router to connect directly to the ISP's line or cable. If the router does not contain a modem, then a connection to an ISP will require a separate external modem.
The switch function allows the router to provide connections to more than one computer at the same time. Normally this will include four Ethernet (LAN) ports and possibly a wireless network.
The wireless network extends the switch function to allow a number of wireless devices to be supported at the same time as the Ethernet connected devices.
In contrast, a simply switch rather than a router allows a number of Ethernet connected devices to be interconnected on a sub-net. A switch does not provide management between sub-nets, DHCP services, a firewall, network address translation, or a wireless network.
I hope this helps.