what is the importance of ip subnetting?
Subnet masks can able to divide the network.
For example:
When you look at your connection details you may see
192.168.0.5 and 255.255.255.0 like that this means your are the part of the 255.255.255.0 network.
And in your network there are 253 users with this subnet mask.And technically you can show this 192.168.0.5/24.Only the Routers understands the Subnet mask and also Layer 3 Switches.In both devices they have specific table ,When you connect a new pc ,it send own information to its network and both switches(L3) and routers writes this info to its table.
One more thing These devices keeps the info for their every ports.Ex: You have a 2 port router only for connecting the networks and Routers collects info and knows that in Port1 192.168.0.5 subnet mask is 255.255.255.0 ,Port2 172.16.10.3 255.255.240.0.
Ps:If you want more info I can explain more detailed.