The emerging political reversals of the two Virginias are part of a national shift that has been underway for at least a decade and is expected to reveal itself more clearly than ever this November. As the gap grows between places that are prospering and those that are not, Democrats are strengthening their hold in major metropolitan areas, particularly in places faring well in the technology-driven economy.