This novel was written before World War II broke out, during The Great Depression (as other writings of Steinbeck). Segregation was entrenched in the southern United States. The historical time period is pre-integration. The Civil Rights movement had not yet even begun. Even when World War II broke out, even the military was segregated. There was no justice for Blacks in the south. The Ku Klux Klan was very powerful and whenever a black man crossed them for some reason, they would often send out lynching parties. Blacks were dragged from their homes, tied to trees and hung (lynched). If they had committed a crime, there was no trial, nothing. Just vigilante justice. Most often, their only offense was to look at a white woman, or look at a white man the wrong way.
Crooks is a black man. He is forced to sleep away from the other workers on the ranch. He is segregated, just as in the south. The other workers do not socialize with him and he spends most of his time reading. When George and Lennie arrive, Lennie lacks the social skills to pick up on why Crooks lives apart from the others, so Lennie hangs out with him anyway towards the beginning of the novel. Curly's wife comes over to talk to Lennie and the other men who have joined the discussion for awhile, but when they realize they should not be talking to her (she is a notorious flirt) and ask her to leave, she alludes to the fact that she can make things hard for Crooks, meaning all she has to do is tell her husband that Crooks was in some way inappropriate with her, and watch out. Even though the novel is not set in the South, the treatment of southern blacks was well known throughout the United States and racist attitudes were prevalent nationwide even if outright segregation was not.