I was thinking about this the other day, and began wondering if the fact that coal was a major part of the economy for these states and the north using more coal (for industry & heating) than the south had an impact on them not joining the confederacy.
West Virginia coal mining didn't take off until decades after the American Civil War, for much of the mid to late 19th century Pennsylvania overwhelmingly dominated the domestic American market. Western Virginia's coal economy had been intentionally retarded by the Eastern dominated elite, by a lack of capital and an unwillingness for "foreigners" to invest, and differing views on the shape of America. Western Virginia was actually fairly divided on the American Civil War especially in the south western portion of the future state. Those counties that did tend to side with the Union tended to have fewer slaves, border free states, be tied much more closely economically to free states than Richmond and contain a fair number of former northerners. In addition to the above reasons the eastern and western regions of the state had long been opposed in state politics. Many white western Virginians were not even given the right to vote until a few years prior to the ACW, and Virginia had been locked into a decades old census for representation purposes that did not take into account the virtual population freeze in the eastern parts of the state and the growing western region. Westerners tended to not really oppose slavery for moral reasons (and many employed slaves) but because eastern Virginians had long insisted on state representation including counting slaves, this had given the eastern region a disproportionate amount of power. Western Virginia had adopted an anti-slave platform that can be easily scene in the fallout of the 1829 constitutional convention when Virginia came within a few votes of manumitting its slaves, lead in large part by westerners and valley residents angry over the largely failure in the 1829 convention and Nat Turner's rebellion. West Virginia's decision for statehood was thus largely a continuation of the political struggles between east and west that had dominated the state for decades.
Map for reference secession by county http://collections.richmond.edu/secession/visualizations/vote-maps.html# note the large number of West Virginia counties that voted for secession
For coal mining in Virginia and Pennsylvania I can't recommend enough Old Dominion, Industrial Commonwealth: Coal, Politics, and Economy in Antebellum America
/u/borimi does a lot on Kentucky and could speak more to coal mining in that state, but because Pennsylvania dominated the domestic coal market I doubt it played much of a role