A little explanation for the sake of clarity is in order.
Basically, the .30 Luger cartridge case is dimensionally identical to the 9mm Luger EXCEPT it is tapered to accept and hold a smaller .30 (versus .355) bullet. The .40 S&W cartridge is essentially a cut down (shortened) 10mm cartridge case and uses a 10mm bullet. That said, the magazine built to hold 13 rounds of 9mm will accomodate 13 rounds of .30 Luger given that the significant outside dimension (case diameter) is the same. The .40 case having a proportionately larger case diameter than the 9mm/.30 Luger takes up more space. Hence, 10 of the former take up as much space as 13 of the latter.
As for magazines feed lips, there are several things they do:
1, they hold the cartridge in the case so that it doesn't come out until 'pushed' out. 2, they hold the cartridge in a correct position to allow and promote efficient feeding (understating - facing into the chamber). 3, they actually 'guide' the cartridge into the chamber as it is being 'force-fed' into it by the slide moving into battery.
That being the case, the shape, geometry and tolerances of the feed lips becomes the product of some complex (far too much for my feeble mind) physics and mathematics that are unimportant to us, the users, so long as they are correct.