In addition to the other answer there are a few points I think are important. For one many African American service men, most who had never left the farm or city, were exposed to a vastly different society and racial attitudes in Europe. They came home more idealized and realizing that there was much much more to be offered them in life.
Also in this time period was the Great Migration, where half a million blacks left the deep south and missisippi delta for work and opportunities in the north. This lead to a great improvement in job prospects, housings, standards of living, etc. As stated here
Wartime opportunities in the urban North gave hope to such individuals. The American industrial economy grew significantly during the war. However, the conflict also cut off European immigration and reduced the pool of available cheap labor. Unable to meet demand with existing European immigrants and white women alone, northern businesses increasingly looked to black southerners to fill the void. In turn, the prospect of higher wages and improved working conditions prompted thousands of black southerners to abandon their agricultural lives and start anew in major industrial centers. Black women remained by and large confined to domestic work, while men for the first time in significant numbers made entryways into the northern manufacturing, packinghouse, and automobile industries.
The impact of World War I on African Americans often receives less attention than the effects of the Civil War and World War II. Because racial conditions failed to improve significantly after the war, it is often viewed as a disillusioning moment. To the contrary, World War I brought about tremendous change for African Americans and their place in American society. The Great Migration transformed the demographics of black communities in the North and the South. The war effort allowed black men and women to assert their citizenship, hold the government accountable, and protest racial injustice. Military service brought thousands of black men into the army, exposed them to new lands and new people, and allowed them to fight for their country. Black people staked claim to democracy as a highly personal yet deeply political ideal and demanded that the nation live up to its potential.