A subnet, or subnetwork, is a smaller network within a larger one.
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.
Check out this article for more information about subnets, subnet masks, and how they work.