I don't believe that Smith & Wesson ever owned the police semiauto market to begin with. They would have had to have it first in order to lose it.
S&W did own the law enforcement REVOLVER market prior to the influx of the semiauto pistols. I think S&W failing to acquire a big share of the pistol market had a lot to do with timing and the number of competitors.
S&W manufactured the first American-made, popular double action semiauto, the Model 39, and then invented the double action/high capacity pistol with the Model 59. Their initial competition was mostly single actions like the Colt 1911. American law enforcement traditionally changes things very slowly; we like to do it that way because we always did it that way. Plus, different, better sidearms were a pretty low priority until the officer survival movement gained steam, fueled by violent social unrest beginning in the 1960's and the cocaine wars of the 1980's.
Other makers, mostly foreign, began to be imported. Sig-Sauer, Beretta, H&K, then Glock. The "civilian" market found high capacity semautos to be very attractive. The cops began to feel somewhat under-gunned.
By the time the officer survival movement had enough traction to push police administrators into looking at something better than six shot revolvers, there were plenty of established semiautopistols to choose from.
It was then a combination of timing, user features and price that led to the domination of Glock. By the time most departments decided to switch from revolvers to semiautos, or found their initial semiauto choice wanting somehow, there was the Glock. It was light. It was simple to use, with no safeties to manipulate. It was used the same way the revolver was used, draw point and pull the trigger. No decock, no safety to put back on. It was high capacity. It was reliable. The stockless frame made it somewhat easier for smaller handed shooters than, say, the Beretta 96. Plus, it was cheap to make. Glock was smart enough to combine these factors with aggressive marketing and then product diversity.
Reliable, simple and cheap. In the right place at the right time with a good product at the best price.
There we have it.