When we looked at IPv4 we covered the concept of the CIDR range. This range is used to define the size of a network, and therefore how many usable IP addresses we get inside of it. These subnet masks are used to determine if the IP address you're trying to communicate with is inside or outside of your own network.
Let's say we have two computers:
192.168.1.10/24 (our address) and
192.168.2.30/24. Because we know a
/24 gives us
254 usable address, we know that
192.168.2 are different networks. We also know this because the
/24 means the network is made up of the first three octets in the address.
If we want to talk to
192.168.2.30/24 from our address our operating system knows this is outside of our network. So what happens?
The kernel sends the data to the "default gateway", which is common way of saying: to the router.