Sarah Lewis, the brilliant art historian and curator, won a wide audience a few years ago for her book “The Rise,” which has an interesting subtitle: “Creativity, the Gift of Failure, and the Search for Mastery.”

The most important element in that trifecta is “the Gift of Failure.” Being of a (perhaps excessively) hopeful temperament, I was much taken by Lewis’s insistence upon the “vital, constant truth that just when it looks like winter, it is spring.”

At Thanksgiving, it’s conventional and proper to give thanks for the people close to us — our families, friends and colleagues — and for other blessings that life may have bestowed upon us. Lord knows I have a lot to be thankful for.

But inspired by Lewis, I’d like to suggest that we consider giving thanks for something else as well: the possibility that this moment of chaos in our political and social life may be part of a necessary exercise in social learning, and that it came just in time.

If what has seemed like a cold winter for democratic values turns into spring, it will happen because we understood two things before it was too late: the value of democracy itself, which we took for granted, and the urgent need to tend to deep social disorders that were corroding democracy without our fully realizing the extent of the decay.

Democracy is messy, unpredictable, fractious and profoundly imperfect. People in any given democracy are almost always critical of the version they have — some seeing it as too democratic, others as not democratic enough. That’s why it tends to be most appreciated by those who have lost it, those in danger of losing it and those who never had it.

Of late, we have been reminded of the risks brave people are willing to take to win or preserve democratic rights.

The freest part of China — for now — is Hong Kong, and its citizens last Sunday used a municipal election to shout for freedom as loudly as they could. They gave a landslide victory to candidates who support democracy and stood in sympathy for demonstrators who have risen in protest against concessions their local government proposed to make to China’s dictatorial leaders.

It was said there was a silent majority that supported Beijing. In fact, the majority was not silent and said nothing of the sort. The front page of Monday’s Los Angeles Times carried what bids to be the good-news headline of the year: “Pro-democracy voices roar in Hong Kong vote.”

In Turkey and Hungary earlier this year, voters also used the rights they have in the face of increasingly authoritarian regimes to rebuke their governments in local elections. In both countries, a desire for restoring democratic freedoms overrode the opposition’s fractiousness.

But if we appreciate democracy now more than we did, we also understand that it rests on far more fragile ground than we realized. It should not have taken the election of Donald Trump for those in well-off precincts to pay attention to the economic turmoil in the parts of the country they largely ignored. But it did. It should not have taken Trump’s noxious divisiveness to show us how large an audience there is for racist and nativist appeals. But it did.

You don’t have to support Bernie Sanders or Elizabeth Warren to take seriously what Adam Tooze, a Columbia University historian, wrote earlier this year in the New York Review of Books: “Only a few years ago the mood in the Democratic Party establishment was not one of defiant resistance. What prevailed was bland futuristic complacency.”

Complacency is now off the table, and even politicians of moderate leanings offer proposals for economic reform far more adventurous than anything they would have endorsed even five years ago. In the Democratic presidential debates, the arguments are over how fast and how far-reaching change should be, not about whether it’s urgently required.

It would, of course, be another form of complacency to declare that spring is already here. Authoritarians, after all, still hold a lot of power in a lot of places. And to pick up on Lewis, failure is a gift only if it leads us to wisdom and only if we make something of it. The question for democracy is whether its travails move us to do what it takes to save it and deepen it.

But we can be thankful that we at least know that it needs saving, that the job is harder than we thought, and that it’s worth undertaking.

Read more: