A router is what separates networks / subnets. It is the Gateway to another network, and plays the role of forwarding messages from one network to another.

Used in combination in a Network Switch.

A router creates a local network. It routes data from one network to another based on their ip address.

Router: Directs network traffic between your home network and the internet.

A router links multiple networks together and routes data packets between them. In a home network setup, it usually connects your LAN to the internet (via the modem). The router assigns local IP addresses to all devices in the network and directs incoming and outgoing internet traffic.

Most modern routers also come with additional features like firewalls, VPN support, and quality-of-service (QoS) settings.