Well as someone who grew up in Virginia and had to take an entire year of Virginia history as a lad I know the answer to this pretty well.
First, this wasn’t over slavery. In the grand scheme of things, the ACW et cetera, I don’t want to get into that. The Virginia/West Virginia split was not about slavery per se. The western Virginia counties did not profit immensely from slavery, but there also was not any great moral outcry against slavery either (in fact the first West Virginia constitution did not prohibit slavery.)
Physiclaly the two areas were divided pretty seriously by the mountains. If (like the OP) you’ve driven around the Virginia/West Virginia border much you will find yourself having to take tunnels under the mountains to get from one state to the other, and the area’s interstates are literally carved right out of the mountains resulting in sheer cliffs towering over you on both sides.
There were many differences between the residents of both parts of Virginia.
Virginia helped settled the western counties but in large part Virginians weren’t the ones who moved in. Several Virginia governor’s sponsored explorations throughout the western area and George Washington even surveyed extensively in modern day West Virginia. But by and large the people who were moving into the western counties were not Virginians, but other groups coming from the north through Pennsylvania. A lot of them were Scots-Irish and German, which set them quite apart from the predominantly English Virginians to the east.
Geographically West Virginia wasn’t suitable to plantations, so they just never came up there. West Virginia’s industries were salt mining in the early days and eventually coal (although the famed coal mining really didn’t start until after the split.)
During the Revolutionary war the west already was wanting to break away from Virginia, and there were efforts to establish a new colony there but it never gained any serious support from the rest of the colonies.
As the years progressed in the young republic the animosity between east and west grew. The eastern counties had more people in them than the western counties. However, that difference was reduced significantly when you factored out all of the slaves who could not vote.
To make sure their interests were maintained the eastern plantation owners more or less entrenched their power within the state. In 1829 after years of bickering between the two sides a new constitution was drawn up for the state.
In it the eastern counties more or less cemented their rule. They introduced a property qualification for voting in state elections, immediately disenfranchising many western Virginians. On top of that they insured that slaves continued being counted for the purposes of apportionment. The eastern plantation owners reduced the number of eligible voters in the west and also gave the west disproportionately small representation in the legislature.
Up until the civil war the constitution of 1829 kept the west under control, it had no effective means to protest politically. The western counties had a lot of valid complaints. They were paying state taxes but the government to the east gave out funding to thewest in disproportionately low amounts. While the west was unable to politically thwart the east, resentment grew.
When Virginia seceded in 1861 the western counties acted swiftly (the vast majority had rejected secession, which was meaningless since the western counties were politically castrated by the constitution of 1829) and formed a convention in Wheeling. The first convention waffled since Virginia had yet to officially secede, and they agreed to meet again once it had become fact. Once Virginia was truly out of the union there was a second Wheeling convention. It was declared the the Secession Convention had acted without the authority of the people, and all officials who had supported secession had vacated their offices. New officials were elected in Wheeling and Francis Pierpont was chosen as the governor of Virginia (the Commonwealth does not recognize him in the line of governor’s, for obvious reasons.) So effectively there was now a mini-civil war inside the bigger one, one state was divided just as the nation itself was. On one side there was a Virginia government loyal to the union and on the other there was one loyal to the confederacy.
The decision of the western counties comprising all of modern day WV except the eastern panhandle to break away is without much question. Via overwhelming majority these counties voted to break away from Virginia. What is now the eastern panhandle of West Virginia is a different story. The eastern panhandle mirrors an important transportation route both sides wanted during the war. There weren’t any serious contests over it, but there were small-scale movements throughout Virginia/West Virginia to secure strategic areas. Some small west virginia towns changed hands dozens of times during the war. The “loyal” government of Virginia eventually split away to form a whole new state. This is not legal without the consent of the legislature of the original state. Technically the official legislature of Virginia was no longer recognized as being in Richmond but in Wheeling.
When West Virginia officially petitioned for existence in 1862, the counties east of the mountains were favorable to the matter. However, in large part that is because the vast majority of the population of those counties that remained were those loyal to the union. More than likely had the confederates (soldiers off on campaign and civilians who fled south) still been there the numbers would have been different. As someone else has already mentioned Virginia later objected to these counties being given to WV. More than likely the SCOTUS ruled against Virginia in large part because the federal government was still pretty anti-South and anti-former confederates at that time, and that was reflected even in the courts.
West Virginia has actually won its land disputes with all states who have ever challenged it. At one point Maryland challenged for parts of the eastern panhandle and was defeated, Virginia challenged for the eastern panhandle and was defeated, and disagreements between Ohio and West Virginia ultimately resulted in the entirety of the Ohio river along the Ohio/West Virginia border being placed in West Virginia.