I posted this in in response to a post in the Pistol section. Then I figured it may deserve its own thread...
It's so weird.
Late 1990's and early 2000's you couldn't give away a 9mm police surplus pistol. Everyone wanted 40 S&W. How times have changed.
I think most of us were introduced to the 40 S&W in a 9mm pistol that had been re-chambered for the much hotter round (and in the case of the Glock it was a woefully inadequate re-chambering).
Most PD's had carried 9mm in either 115 gr or in 147 gr. My own department carried 115gr Winchester +P+ and practiced with Winchester 115gr White Box. If you've shot a lot of WWB 115 gr you'll know it's an absolute pussy-cat of a round with very little recoil.
In 2006, I remember shooting 115gr FMJ in a Glock 17 next to a 155gr FMJ in a Glock 22. The contrast in recoil/snap was drastic.
As @JonInWA noted, over time, the guns designed to shoot 40 S&W have been beefed up. At the same time, most of us are shooting 124gr 9mm and I've noticed that most modern 9mm loads are a little bit spicier than the more anemic 115 gr loads were back in the 1990's. The Gen3 and Gen4 Glock in 40 S&W sucked and I think can be credited partially with the slow death of what is fundamentally a good cartridge. The FBI adopted the Glock in the caliber with a whole lot of other departments following suit. It's a hard gun to shoot well, especially for people that don't like to shoot at all or practice very little (most people). Throw in the debacle that was the G22+WML and you had a recipe for its decline.
Last year, in 2022, we shot S&W M&P's that were setup identical side by side. A 40 S&W with WWB 180gr FMJ and a 9mm with WWB 124gr FMJ. The difference between the perceived recoil of the two was so minimal you could barely tell the difference. The difference was ultimately one held two less rounds than the other.
The loadings of the two cartridges have gotten closer and over time the guns have been beefed up and improved.
I never thought I would be an apologist for the 40 S&W, but I sort of am. ToddG would be trying to smack me in the back of the head right now. Over the years I have been to quite a few workshops where we shot through auto glass and other barriers with different calibers. The 40 S&W has always performed very well, regardless of the load. The same cannot be said for 9mm. The simple fact is the 40 S&W is much higher pressure and has more mass on the bullet. The 9mm has to rely more upon the technology of the bullet design to make up for its shortcomings.
Ultimately though, for most, the 9mm is just a little easier to shoot, puts less wear on guns, is cheaper for departments to buy, and the guns that shoot it hold just a couple more bullets. Combine that with better bullet tech for 9mm and I think the 40 S&W will be relegated to second-rate caliber in the eyes of most people.
Still, if I had to go into a hypothetical shooting and I had to pick between a S&W M&P with 10 rounds of 9mm or 10 rounds of 40 S&W with an identical bullet design...logic would lead me to pick the 40 S&W every single time because when all things are equal it is actually a slightly more effective cartridge, especially when shooting through glass or heavy clothing.
Ultimately, the 40 S&W gave us better 9mm service pistols, better 9mm loadings, and all around improved service weapons.