Today’s Republican party is unrecognizable from 1865. In that year, Republican President Abraham Lincoln and future Republican President Ulysses Grant oversaw the defeat of the southern Confederacy, thus freeing African Americans from slavery. For decades, the Republicans were the progressive party while Democrats, such as Klu Klux Klan sympathizer President Woodrow Wilson, advocated for Jim Crow racial segregation laws. Today, the Grand Old Party is the purported purveyor of conservative values, and Democrats are the supposed liberals. What happened?
The Road to Realignment
A hundred years after the outbreak of the Civil War, much of the American south was still segregated. African American activists orchestrated acts of mass civil disobedience in protest of enforced racial segregation, which pushed newly elected Democratic President John Kennedy to support the Civil Rights Act. The Civil Rights Act sought to outlaw state-sanctioned racial segregation and discrimination across the U.S.
His position drew wide support from African Americans, but it also sparked a backlash from racist white voters. Kennedy was murdered in 1963, and a reluctant President Lyndon Johnson was left supporting his legacy. Fortunately, groups of African American activists and their allies continued to rally support through various violent and non-violent protests, and the Civil Rights Act eventually became law in 1964. 
In 1964, Republican senator and presidential candidate Barry Goldwater saw an opportunity. Goldwater promised to overturn the Civil Rights Act. At the same time, Goldwater claimed to be against segregation; he simply championed the rights of individuals and businesses to discriminate against whoever they pleased. Despite losing to Johnson in the 1964 election, Goldwater garnered substantial support from white southern Democrats whose great grandparents had committed treason a century prior in order to keep black people enslaved. 
Goldwater fell short in the 1964 election, but President Richard Nixon successfully courted southern white voters in 1968 with his appeals to “law and order” and “states rights.” He purposely stoked the fears of resentful whites by painting African American activists as anti-American criminals. He claimed to speak for the "silent majority," which was obvious code for white people. He declared "war on drugs," which was an admitted excuse to target his political opponents and anti-war protestors. This tactic was called the southern strategy, and the Republican National Committee has since apologized to the NAACP for it. 
In some ways, Nixon was actually a liberal by today’s standards. He created the Environmental Protection Agency and expanded social security. Unfortunately, he was also a megalomaniac who lacked scruples. Facing an FBI investigation due to the Watergate scandal, Nixon fired top FBI officials in an admitted attempt to obstruct justice. He became the first and only president to resign from office to avoid the embarrassment of removal by Congress. 
After that, the Republican brand suffered for a while. Nixon was an unabashed authoritarian who said things like “If the President does it, that means it’s not illegal,” which would theoretically give him the right to personally shoot someone on Fifth Avenue in Manhattan. Republican voters weren’t quite ready for that yet. 
The next major turning point came in 1980 when former Hollywood actor and then President-elect Ronald Reagan obliterated incumbent President Jimmy Carter on the electoral map. As the inventor of the phrase “Make America Great Again,” Reagan married the libertarian ideals of Barry Goldwater with Nixon’s thinly veiled white nationalism. He won 44 states thanks largely to the “Reagan Democrats,” or Democrats who voted for a Republican candidate for the first time ever. Realignment was complete. 
A New Order
Reagan slashed taxes for the wealthy while exploding the national debt. He criticised “welfare queens” while touting the junk science of supply-side economics that defines the Republican party platform to this day. He told Americans to “pull yourself up by your bootstraps” while opposing affirmative action policies. He repealed the Fairness Doctrine, which opened the door for biased "talk news" show hosts like Rush Limbaugh. He made “God bless America” a catchphrase while ignoring an AIDS crisis that primarily affected the LGBT community. He proclaimed, “Government is not the solution to the problem; government is the problem,” which sounds ironic coming from the leader of the government. Nonetheless, his clever sound bites convinced many Americans to vote against their own economic interests. 
Meanwhile, Democrats still largely held control of Congress despite losing many resentful white voters. With his teflon charm, Reagan had set the tone for the rest of the 20th century: Neoliberalism was the order of the day. Democrats like President Bill Clinton and Vice President Al Gore would eventually embrace many of the same extreme free market policies pushed by Reagan. 
Nonetheless, the Republican party swung to the hard right following Clinton’s election in 1992. While Clinton advocated for socially liberal policies such as allowing gays into the military, Republican Speaker of the House Newt Gingrich preached “family values” in an appeal to homophobic Christians. In 1994, the GOP once again encouraged the prejudices of voters and reclaimed both houses of Congress for the first time in 40 years.  
The Republican party would use similar tactics ten years later to ramp up support for President George W. Bush’s 2004 reelection campaign. After Massachusetts legalized same-sex marriage, Bush and Karl Rove supported a constitutional amendment to define marriage as “one man and one woman.” The Republicans again used homophobia to win support from evangelical Christians while slashing taxes for the wealthy and adding to the national debt. During that time, the Fox News Network became unofficial state sponsored media, which gave the Republican party a new 24/7 media platform.  
Democratic President Barack Obama’s election in 2008 sparked another Republican backlash. Obama was the first African American president, which didn’t sit right with a large number of white people. Despite the passage of the Civil Rights Act decades prior, racist attitudes still prevailed. In the month following Obama's election, more than 200 hate crimes were reported, and membership in white supremacist groups like the KKK began to surge. Less than a century prior, the Klan had supported Democrats; now, they were clearly aligned with the GOP.  
A new faction of Republicans, the Tea Party, gave the GOP a congressional majority in the House of Representatives in 2010. These Tea Partiers were staunch Reaganites who believed in capitalism, nationalism and Christian values. Some of their supporters spouted crazy conspiracy theories about communism and death panels. For example, current President Donald Trump publicly questioned Obama’s citizenship status. 
Thus, the 2012 Republican primary was a circus filled with bozos like Pizza salesman Herman Cain, homophobe Senator Rick Santorum and religious zealot Representative Michele Bachmann. They slandered law professors like Obama as “elitist” while spreading misinformation about climate change. They branded the Affordable Care Act "Obamacare" and criticized it for being “socialist.” Ultimately, the most moderate candidate earned the official party nomination, but the GOP and its voters had shifted even further to the right. 
In 2014, the Tea Partiers, now known as the Freedom Caucus, drove Republican House Speaker John Boehner to resign because he wanted to make legislative compromises with the Obama administration. Decades of the GOP’s racism, religious pandering and anti-science rhetoric had encouraged a new generation of Republicans to rise up, and the party was split between the conservative old guard and their rowdy, ultraconservative base.  
The March to Trumpocracy
Then, in 2015, socialite and professional con man Donald Trump capitalized on the resurgence of white racism by channelling it toward a new enemy: immigrants. During the opening days of his presidential campaign, he called most Mexican immigrants "rapists and criminals" and promised to ban Muslims from entering the country. He held rallies where he promised to make Mexico pay for a wall along the southern border. He encouraged violence against protestors at his political events. For his efforts, Trump earned the support of KKK Grand Wizard David Duke. 
Trump was seen by mainstream media outlets as a joke from the very beginning of the presidential race. During the first GOP primary debate, which was hosted by Fox News, he was grilled rather relentlessly by the panelists. Even the GOP's propaganda wing initially underestimated his appeal to Republican voters. Meanwhile, the other news networks gave him round-the-clock coverage as he said and tweeted increasingly ridiculous things. 
How did a racist reality TV star with no political experience become president of the most powerful nation in the world? That’s a loaded question, but it’s very easy to see why Trump won the Republican primary. If you think about it, Trump has all the tools for a GOP total package: Goldwater’s preference for the rights of businesses over humans; Nixon’s nepotism and disdain for democracy; Reagan’s religiosity and anarcho-libertarianism; Bush’s clownishness and ineptitude.
The GOP has been pandering to the anxieties of white Christians for over a half-century, and it’s proven to be a winning strategy for them. Republican politicians have encouraged voters’ hatred for government, mainstream news media, and science. No wonder their base has rallied behind a man who calls climate change a Chinese hoax, labels mainstream news networks “the enemy of the people” and has absolutely no idea how the government works. 
As of 2018, the party that once freed the slaves has capitalized on xenophobia to win control over all branches of government, and the Republican president has the support of neo-Nazis and evangelical Christians alike. The narrative above is just one way to look at history, but from this perspective, Trump’s presidency shouldn’t be too surprising.
Additional information from: