They picked the number 7, because it bans 95% of all handgun models in NY ... Period.
The law doesn't ban the guns themselves. It simply screws over law abiding gun owners by making their 10 round magazines illegal unless permanently modified to hold 7 rounds.
But, the idiots who wrote the law have no real knowledge of firearms, and naturally it's not so cut and dry to just put a 7 round limit into place. The Garand is one example, since it's en bloc holds 8 rounds but the first round is immediately stripped off into the chamber, leaving only 7 in the gun. Shotguns are another big question, since different size shells leave the gun with different maximum capacities.