Subnetting is taking the original subnet mask and adding bits to it to create more networks. In other words, if you convert a subnet mask into binary form and add more 1s, you are subnetting that network. The more is that are present in the subnet mask means the more networks with a fewer number of hosts.
The more 0s that are present in the subnet mask means the fewer networks and the more hosts you have. In other words, the subnet mask tells routers and computers which portion of the IP address is for the network and which is for the host. If you slide the line between network and host to the left, you create fewer networks and more hosts. If you slide the line to the right, you create more networks and fewer hosts.