The parties switched the locations of their bases in the 60's/70's which led to them changing some of their politics but not all of them. The Republicans used to be the party of the North (roughly defined as the states which did not leave the union during the Civil War) while the Democrats used to be the party of the South.
The Republicans, representing the industrial bases of the Northeast and Midwest, were strong proponents of business interests and capitalism. Also, since they represented many large cities, they generally preferred strong safety nets, progressive social politics, and were friendly to immigrants.
The Democrats, representing the agricultural bases of the South and Southwest, preferred government intervention in the economy to ensure that farmers weren't wiped out economically by a single bad year, or weren't at the mercy of the powerful Northern industrialists. The rural South was generally less progressive and less multicultural or comfortable with immigration than the North was.
As the labor movement grew in the early decades of the 1900's, the Democrats saw a way to try to pull votes away from Republicans by joining with the Unions against the industrialists. The unions were a somewhat natural fit for the Democrats, as they were both anti-capitalism and they were, frequently, explicitly or implicitly racist. Unions (notably the AFL) would either completely or partially prevent black people from joining. This helped bolster the earnings of white labor, which was the bulk of the Democrat's voting base. Keep in mind that in the 1920's the effects of the civil war, and slavery, were still felt strongly. Black voters in the South still remembered that the Republicans fought and died for their freedom, and white voters still remembered that the Republicans fought and killed their family members.
So by the 1960's, we had two parties - a party of the South, the Democrats, who were economically "left" and socially "right" and a party of the North, the Republicans, who were economically "right" and socially "left".
The Civil Rights movement really started to change things in the 1960's. Kennedy - a northern Democrat, though with some very Republican (at the time) politics - won both the North and the South in 1960. By 1964, with LBJ having signed the CRA and his Republican opponent, Goldwater, having opposed it the South, known for having voted Democrat for nearly a century, voted Republican. They were, basically, willing to vote for different economics in favor of their preferred social policies.
So, the parties, in the span of about 16 years (1960-1976) completely flipped their geographic bases. That meant that the policies that they'd pursued based on those locations were now different - the Republicans were still just as pro-industry as before, but were no longer socially progressive. The Democrats were still allied with the labor unions, but with a new base in the Northeast cities, were now in favor of government handouts.