This question already has an answer here:
Is there any particular reason as of why we should assign IP addresses to the largest subnet first? Could anyone give a simple example of why this is the better option?
Let's say I have two subnets: one for 40 hosts, and the second one for 4 hosts. How come that starting with the smaller subnet would cause a bigger waste of IPs? The hosts take the same number of IPs no matter what IPs were assigned to them.