Subnetting allows large Class A or B networks to be divided into smaller subnetworks to better manage IP addresses internally. It works by using some bits from the host portion of the IP address as a subnet ID. This allows a company to use fewer overall addresses while creating multiple physical networks. When designing a subnet solution, the number of required physical networks is established and the network is subnetted to provide at least that number of subnets while ensuring enough remaining host addresses per subnet.