Charlotte a culturally Southern city, Raleigh has the research triangle which makes it more culturally Northern ala the DC suburbs or the city of Durham. At least I think that explains it very basically.
Why did this become a thing? I know as late as 2004 Wake was more conservative then Mecklenburg County (and still is today). What's the difference there?
Raleigh is significantly whiter than Charlotte but Raleigh whites are more Democratic leaning than Charlotte whites.
As for why, as stated upthread, whites in the Raleigh area tend to be highly educated, oftentimes more socially liberal types as a result of the importance of high tech industries and education to the Triangle.
https://twitter.com/PoliticsWolf/status/1194803339260657665Not education. Its a cultural difference although Charlotte educated white areas moved left too.