I know but that’s all it takes to run NYC
He stepped in when the Pandemic and lockdowns were leading to certain kinds of crime increases in cities across the U.S. The NYC media used the crime increases to push anti-bail reform narratives and effectively scaremonger. So Adams, being a former cop, was able to push himself as the "no nonsense" alternative to more progressive options.
In the meantime, the best progressive options to run were waiting to see if Kathy Hochul's position was weak enough to run for governor. That left a a handful of progressive and somewhat progressive options splitting up votes among each other, while more conservative-leaning Dems congealed behind Adams. To top it off, Adams' policing clout got him quick support for powerful police and real estate powers.
It was a bit of a perfect storm. Progressives splintered, the center looking for an answer to NYC's progressive push, and conservative-leaning Dems finding their spirit-animal in a corrupt former cop.