A subnet, or subnetwork, is a smaller network within a larger one.

A simple network / subnet. Source: What Is My IP Address?

Subnets make networks more efficient by simplifying routes from one computer or server to another.

Also, because subnets allow us to break up networks into smaller ones, they've dramatically increased the number of devices that can connect to the internet.

Without subnets, every internet connect device would need its own IP address. There are only about 4.2 billion possible IP addresses under the current IPv4 system, so we would have run out many years ago.

Subnets often work with a subnet mask, which acts as a soft of filter for internet traffic. Using an IP address and a subnet mask, devices can figure out of another device is part of the same network (connected to the same router or within the same company), or is somewhere else online.

An IP address and subnet mask. Source: IPv4

Check out this article for more information about subnets, subnet masks, and how they work.