My grandfather, a buttonhole maker, believed his first responsibility was to be a provider. His union supported that role and the Democratic Party was the workingman’s champion.

Some New Deal policies benefited him, but with a grade school education, I doubt he ever gave great thought to how fair trade laws made appliances more expensive or how Secretary of State Cordell Hull’s freer trade agenda would ultimately decimate the apparel industry.

His cohorts’ politics were tribal. They supported politicians with corporatist and globalist agendas that sometimes worked against their interests.

My father, a high school graduate, spent his career on the first rung of management, supervising salesmen who peddled life insurance door to door. He put his family and company first and embraced the Republican Party because he wanted to identify with the management class.

He was antiunion, in favor of low taxes and against wasteful government spending. Ironically, three of his children owe their considerable prosperity to progressive institutions and policies — the State University of New York and generously subsidized tuition.

Nowadays, we like to think a better educated citizenry carefully assesses policies on trade, immigration, health care and the like and bears fidelity to political parties and candidates based on appraisals of what they offer. And the combined wisdom of an engaged electorate will prudently steer our government.

In “Democracy for Realists,” political scientists Christopher Achen and Larry Bartels offer significant evidence that that assumption is wrongheaded. Instead, voters still choose political parties and candidates based on social identities and adjust perceptions of facts on the ground and policy prescriptions to match party loyalties.

Nearly 90% of Republicans are happy with the performance of the overall economy but fewer than 40% of Democrats are. Presidential approval ratings through both the Obama and Trump years have been little correlated with fluctuations in consumer confidence, which reflect household assessments of more specific conditions.

Few voters have time to understand the machinations of economics and government policy, and they rely on leaders who share their values to guide their thinking.

The trick to winning elections consistently is to build a big tribe and then persuade enough of the 15 million swing voters with expensive data analytics. Those profile individuals through surveys, purchases and web-surfing habits and then bombard them with surgically targeted social media messaging, videos, direct mail and walk and phone contact for registration, persuasion and turnout.

In seminal presidential elections, the winning candidate steals major segments of the other party’s tribe — Ronald Reagan garnering blue-collar union voters and Barack Obama’s outsized success with younger voters and college grads — and perhaps keeps a significant slice for his party in future elections.

To build a tribe in an ethnically diverse, gender role-evolving, post-industrial America, parties must eschew binary divisions like workers vs. management but instead pick big villains that can unite a more fragmented electorate.

Donald Trump characterizes undocumented immigrants — most recently the recipients of DACA — as criminals. The statistical evidence does not bear this out, and the denial of Trump’s core supporters truly tests the outer boundaries of cognitive dissonance in service to self-interest.

Virtually all Elizabeth Warren’s “plans” are premised on scapegoats — big banks, business and billionaires.

Warren, Bernie Sanders and others are truly testing the limits of envy politics, which has not proven a winning electoral formula in Europe and may be why their hopes are fading here. However, indoctrination into the secular religion of identity politics at American universities may yet make this a deciding strategy among suburban voters with degrees.

Candidates and public officials can advocate the most irresponsible policies. For example, failing to accept millions more immigrants will smother our economy. The birth rate of native-born Americans is too low to sustain our labor force and support the elderly.

The Green New Deal would make U.S. cities and homes uninhabitable. By 2030 or even 2040, does anyone have the math to demonstrate  that electric vehicles could be competent and plentiful enough to replace all the petroleum-powered trucks that supply Manhattan and other cities with daily necessities or every gas furnace in America could be replaced by heat pumps and solar energy?

In the absence of reason, recurrent voter frustration encourages new demagogues to oust incumbents.

If you don’t like Trump, wait and see what the next man — or woman — on a­ white horse does.

Peter Morici is an economist and business professor at the University of Maryland, and a national columnist.