Prisoners are counted in the census statistics as residents of the county/city in which they are incarcerated, not as residents of the county/city from which they were convicted.
People accused of a crime, and not released from custody before trial, are kept in local jails or regional jails. If found guilty of a local crime, the prisoners remain in local jails. After conviction of a state offense with a long-term punishment, Virginia normally shifts convicts from local jails to state prisons. This transfer has increased the population of rural counties that were otherwise losing population, such as Sussex and Greensville (home of Virginia's largest prison, with 3,000 inmates). Wallens Ridge adds 1,000 people to the Town of Big Stone Gap and Wise County.
Increased population results in increased Federal payments to many communities with jails. Communities like Henrico County that supply prisoners (residents who are incarcerated outside the county) lose payments that are based on population.