Last year, Alexandria Ocasio-Cortez shocked the nation when she ousted a powerful 10-term Queens congressman.

Last week, Ms. Ocasio-Cortez and her supporters seemed to do it again when their endorsed candidate declared victory in the race for Queens district attorney, signaling another advance for their bold agenda and grass-roots campaign.

But then officials started counting the final paper ballots.

[Read more: The Shocking Final Count in the Queens D.A. Race: What Happened]

Why is there an election now?

In January, the longtime district attorney in Queens, Richard Brown, said he would not seek re-election. (He died in May.)

There are more than two million residents in Queens and there has not been a competitive election for the position in decades.