There is a thirty year gap between the Emancipation in 1863 and the passage of Jim Crow laws in the 1890's and thereafter. Even allowing for the occupation of the South by the US Army until 1877, on the shaky theory that white Southerners were somehow overawed by the presence of a Union Army that had recently kicked their butts, that still leaves almost twenty years before Jim Crow laws began to be passed.
What happened in between? In the years immediately after the war freed blacks were frequently in power in Southern state governments because they were the only ones eligible to vote. All the whites failed the voter test of not having participated in nor supported the rebellion. By 1877, all the black governments had been replaced by white governments which were then re-admitted to the Union. So, even allowing for the black state governments period, the twenty year gap remains.
Two theories come to mind. One is that their was no need for formal segregation because the Reconstruction South had so few public services, public or private, that there was not much to segregate. And most of life was governed by custom rather than law so, again, there was no need for segregation laws. This would have been reinforced by the fact the generation emancipated from slavery were generally both grindingly poor and illiterate. Their poverty and illiteracy segregated them more effectively than law could have.
By the 1890's there had just started to be a black business and professional class. It would have been this nascent educated class which would have begun to demand equality of treatment by public authorities. The Jim Crow Laws can be seen as responding to these demands by suppressing them.
Another possible theory is that in the decades immediately after the war, suppression of black communities was handled informally and ruthlessly by the omnipresent Ku Klux Klan. By the 1890's the rise of a white business and professional class would have made such tactics seem both primitive and juvenile. Prosperous burghers were not inclined to ride horses at night while wearing hoods and personally committing violence. Respectable people do not do that. They arrange for their legislatures and police forces to do it for them.
To the white rural poor of the 1870's, blacks were potential social rivals who had to be kept in their place. To the white middle class of the 1890's, blacks were employees who had to be kept at a distance. KKK terrorism was personal, often committed against people whose names one knew. Jim Crow segregation was impersonal and institutional.
If I had to put the change in one place in particular, I would say the Jim Crow laws were a product of Southern urbanization. It is hard to say which was worse, the personal violence and hatred of one's neighbors, or the impersonal faceless racist segregation of the cities
. The urbanization hypothesis is reinforced by the fact that the Jim Crow laws were not passed in single bunch but continued to be enacted in a continuing dribble of nastinesses every decade up to and throughout the 1930's, just as the South continued to urbanize through the same period.
With the coming of the Second World War in the 1940's, blacks began to vote out segregation laws by voting with their feet. Vast numbers of people left the Charm and Hospitality of the Old South for war industry jobs in the cities of the north and west.