Any migration of people tends to result from both "push" factors that make them want to leave the place where they are and "pull" factors that attract them to a particular destination.
In WWI, the push factor was the lack of jobs and racial equality in the South. Blacks were very much second class citizens in all ways in the South. The pull factor was war production. With the war, factories around the North needed more people to replace men who had gone into the military and to allow for increased production of things needed for the war. African Americans responded to this, coming North in search of such jobs.