America in the 1930s had a tiny, underfunded military with virtually no equipment. After Pearl Harbor it needed to pull in 16 million bodies and fight a “total war.” About one million of them would be black. They were all subject to massive racism, discrimination, and subjugation. Before the Communists used that as a propaganda tool, the Nazis did. How could America be fighting for freedom when it oppressed black soldiers. How could America care about Jews as an inferior face when they thought of blacks as an inferior race.
Mostly, though, the military - the largest employer of minorities in the country - realized well before 1945 that blacks could be trained, could fight, could be officers, could do all the things an army needed and it was counterproductive to deprive themselves of a powerful weapon. The brighter minds in the military got Truman to issue his Executive Order integrating the military in 1948 but the troglodytes put up enormous internal opposition.
On the civil side, two late 40s precursors were also critical. A more liberal Supreme Court began issuing decrees that institutions be integrated, starting with graduate schools. This infuriated the blatantly racist South so much that it caused a split in the Democratic Party, notably Strom Thurmond’s run against Truman in 1948 on the States’ Rights Democratic Party (the Dixiecrats), winning three states. Throughout the 1950s Southern Democrats were an increasing embarrassment to the rest of the party. Seeing fire hoses and vicious dogs turned on children was not the best lead-in to Father’s Knows Best.
That top-down change in culture was a dull mirror to the boycotts, marches, sit-ins, protests, and daily dogged battles that blacks - especially in the South but also elsewhere - participated in at great cost to themselves. Their courage, dignity, steadfastness, and manifest rightness led to support across the country among whites. Liberal whites for sure, younger whites definitely, but also whites of many varieties who were appalled by the horror and wanted it stopped immediately.
Yes, it became obvious that whites were satisfied by the lip service of the Civil Rights Act and resisted, often violently, any changes in their back yards. Progress remained slow and racist officials soon learned the thousands of loopholes the law offered them. So the old fights and antagonisms started all over again. The best I can say is that the new battles are starting higher up the mountain, which give them a better chance of more than lip service victories this time.