Worldwide, militaries began replacing revolvers with automatic pistols right from the 1900s, and by the 1950s in pretty much any major military, including the US, the revolver was a niche weapon or completely gone.
Similarly, European police forces used a wide range of automatic designs from the early 20th century onward, from adopting military pistols to weapons designed specifically for police use.
However in America, with some exceptions, the automatic pistol failed to take off with police until the late 70s/early 80s. For the rest of the century, the average American cop carried a .38 special/.357 magnum revolver. Why did automatics take so long to make inroads in the American police market (especially long after the American military had switched over)?
An older NY Times article about the NYPD finally shifting from .38 to 9mm might shed some light on this. According to the Commissioner, they were worried of safety and reliability, like accidental discharges. From context of the article, it seemed that other cities also were slow to adapting to the semi-auto pistol (not automatic pistol by the way, just for clarification). The article also talks about something that might be overlooked: budget. Back then, PDs didn't have huge funds (still don't in most cases these days) and access to military surplus wasn't the same like day. One of the arguments against the change was the fact that they'd had to train a lot of officers, including upcoming recruits into using the new 9mm pistols. The .38s were considerably cheaper than their 9mm counterparts.
Somewhat more anecdotally, PDs are a bit based on tradition. Why fix what ain't broke, if I might add. A revolver was a popular civilian firearm for most of the 20th century too.
Might also wanna take a look at this older Askhistorians thread where /u/The_Alaskan and /u/rocketsocks give decent answers to this question that you might find fulfilling.