It’s all on the stupid voters....Garbage In, Garbage Out!
In 2013, Bill de Blasio won the Democrat Primary for NY City Mayor with only 282K votes out of 689K Democrat Party votes cast. In 2017, Bill de Blasio again won the Democrat Primary for mayor with 326K of votes out of 437K cast. Given the power of incumbency, and also that NY, and especially NY City is a one party state, that means that the Democrat candidate will win (which he did in 2017, with about 726K of 1.1M votes cast)
In effect, 282,000 Democrat Primary voters chose the Mayor of NY City out of a population of about 8.5 million.