I believe that Glock made a shorter cartridge with equivalent power to the 45 ACP to allow them to make a smaller grip frame for their 45 pistols. There are a couple schools of thought regarding defensive pistols: small and fast or big and slow to be simplistic. The popularity of the 45 ACP is huge and they were trying to cash in on that with a frame that fit more hand sizes.
I think the 40 S&W was developed when the FBI tried to go to the 10 MM but felt the round was too powerful for a LE round and recoil was too heavy, affecting accuracy with a longer recovery times in a gun fight. The 40 was the result of collaboration between S&W and Winchester to solve these issues. It's my nightstand caliber in a full sized Ruger P94 that has proven to be accurate and totally reliable.
As far as stopping power I think that any caliber from 38 Spl to 45 Acp will work with an accurately placed round. If you get it in the boiler room it will do the job.