Before the Civil Rights Act of 1964, the Republican Party was split between liberals/moderates in the Northeast, and conservatives, libertarians and moderates from the rest of the country besides the South. The Democratic Party was mainly split between the white working class in the Northeast and Midwest, and conservatives in the South who hated and resented Republicans for the Civil War and Reconstruction, plus blacks and other minorities. While a larger percentage of blacks voted Republican in those days, it was still a minority, around 25-33%. And the minority vote was tiny because the black vote was suppressed in the South and the Hispanic and Asian populations were minuscule compared to what they are now.
After Johnson signed the Civil Rights Act of 1964, white liberals in the Northeast became Democrats, a higher percentage of blacks became Democrats, white conservatives in the South became Republicans (or at least started voting for Republicans), and increasing amounts of the white working class started voting Republican, mainly starting with Nixon and then peaking with Reagan (and Trump rode to victory with this vote in the Rust Belt in 2016).
The Southern Strategy, which Lee Atwater came up with and admitted to, and which subsequent RNC chairmen have confessed to and apologized for, embraced white racists in the South and other places, and alienated blacks and other minorities. A majority of Arab Americans and Muslim Americans and Asian Americans used to vote Republican. They now overwhelmingly vote Democrat. And Trump and the nationalist-populist wing of the Republican Party have alienated them even further.