Before the civil war, Virginia was a state that had had slaves for over 250 years.
Populations started to change gradually.
Some slaves began obtaining their freedom. (some escaped, some finished their indetured time, some purchased freedom through saving of wages , or through a good relationship with their masters)
Southern states had economies dependent on slavery, ( crops and tobacco mainly) but the urge for abolition grew in the North. Slavery was a source of conflict between the states as the country grew. The emancipation of all of the remaining slaves took place during the years of the American Civil War