He learned thriftiness from his parents, who grew up during the Depression. Upon becoming a United States attorney in 1981, he had only $750 in the bank, records show. Friends joke that even after he attained the comfortable life of a senator decades later, he refused to replace an aging car or the outdated kitchen countertops at his home in Mobile.

It was an environment that fostered Mr. Sessions’s belief in frugality and self-reliance, bounded by a strict — if much disputed — code of what was and was not fair.

It also bred, even early on, a skeptic’s eye toward elites. His parents were longtime Republicans in a state that had been run by Democrats since Reconstruction. In high school, as racial politics laid the foundation for the eventual Republican takeover of the South, Mr. Sessions was fascinated by Phyllis Schlafly’s book “A Choice Not an Echo,” a catechism on the split between the Republican Party establishment and its right wing. The book enjoined true conservatives to topple the party’s kingmakers and compromisers, presaging the rise of the Tea Party and Mr. Trump — and now, Mr. Sessions himself.

Unpopular ideas did not faze him, even as a schoolboy. His mother told one reporter, “That boy could argue with a signpost.” His high school yearbook photo bore the caption: “He is a host of debaters in himself.”

Alabama’s economic struggles helped define his political priorities. As a young man, he watched timber imports eat into local logging jobs, cheaper foreign steel hasten the closing of Birmingham mills, and immigrants take jobs in the fields and chicken processing plants. Most economists say those changes were largely unavoidable as the United States shifted from an economy based on manual labor to one rooted in services and knowledge. But Mr. Sessions saw a threat to the hard-working families he had grown up with, former aides said.

To Alabama voters, weary of decades of Democratic back-scratching and scandals, Mr. Sessions seemed a breath of fresh air when he emerged on the political scene in 1994, after 12 years as the top federal prosecutor in Mobile. As the state’s attorney general, his first elective post, he slashed staff, pay, travel, cars and supplies. Republican leaders hoped he would come to the rescue of the former governor, Guy Hunt, who was removed from office after a 1993 ethics conviction. Instead, Mr. Sessions asked a federal appeals court to uphold the conviction.

The business-dominated establishment wing of Alabama’s Republican Party is closer to the state’s senior senator, Richard C. Shelby. Mr. Sessions’s political base included rural and suburban working-class and evangelical white voters — the same constituencies that proved crucial to Mr. Trump’s success in November. “Sessions had a Trump movement before there was a Trump,” Professor Flynt, of Auburn University, said.