Danielle Allen, a Post contributing columnist, is the author of “Cuz: The Life and Times of Michael A.”

The last four years have been hard, and this past year hardest of all. But there is one thing for which we can be thankful: We have collectively experienced an intense, accelerated education in the structure of our democratic institutions and the values that anchor them, after decades of declining investment in civics.

The public, after having processed the 2016 election in which the winner lost the popular vote but won the electoral college (and worrying about the potential for the same outcome this year), now better understands how important the states-based nature of our federation is to our politics. The lesson has also been driven home by the dynamics of the Senate, in which senators representing just 44 percent of the population but a majority of the states can deliver Supreme Court justices into lifetime appointments.

The impeachment and trial of President Trump were a project-based-learning curriculum in the checks and balances of our system and required close study of the constitutional requirements of the presidency. The process provided an opportunity to revisit the balance of power between the legislative and executive branches, and to consider why the legislative branch is the first branch listed in the Constitution. It has the job of articulating the will of the people; it should set the strategic direction for the country. The president should execute directions established by the people.

The stand-up behavior of state election officials all over the country in the lengthy process of counting and reporting votes reminded us of just how many elected officials are responsible for the health of democracy. It also highlighted the fact that, at the end of the day, the structures of state government are the foundation supporting the whole system.

The disjunction between the outcomes of ballot propositions and of candidates for federal office forced us to think again about the mechanisms we use for voting. When we vote on ballot propositions, we often achieve supermajorities, as Massachusetts did in affirming the right of small car-repair shops to access car data in support of repairs. So, too, did voters in New Jersey, where they affirmed the legalization of marijuana, or in Mississippi, where they adopted a new state flag. Look at our ballot propositions, and we do not look polarized. But if you look at the results from our federal election, we do.

Why the difference? The use of a plurality voting mechanism in many of our primaries makes it possible for extreme candidates to squeak through and become party nominees. They can then set a more extreme agenda for the whole party, forcing voters into a “two bad choices” scenario. The alternative — ranked-choice voting — requires candidates to surpass a 50 percent threshold. Particularly, when applied to primaries, this ensures that candidates who make it through to become the party nominee have to build a broad coalition. This can be expected to deliver a generally moderating set of incentives to politicians. Trump got through the 2016 Republican primary thanks to the plurality voting mechanism, allowing him to chart a relatively radical course for the party. Voting mechanisms aren’t just for wonks; they are core to our democracy’s health. A lot of people have awakened to this, as is evidenced by the adoption of ranked-choice voting in Maine, Alaska and New York City.

We as a nation invest about 50 federal dollars per child in STEM education, each year. For civic education, we invest about 5 cents. As the old saw has it, you get what you pay for. A democratic society has to equip itself with civic strength by offering its rising generation an education that inspires their commitment to constitutional democracy and equips them with the knowledge and skills needed to sustain self-government for free and equal citizens. We haven’t been paying for civic education for some time, and it shows.

The past four years have been a very expensive way of closing an achievement gap on civic knowledge — the gap across our whole population between where our civic knowledge is and where it should be. Perhaps it’s time to educate ourselves more straightforwardly by investing in civic education in K-12 and by rebuilding the capacity of higher education institutions to teach American political thought, U.S. political institutions and the theory of democracy and civic participation.

I am thankful for the education we’ve had over the last four years. Now, I hope we can do right by it and directly invest in civic education for our children.

Read more: