With an economy that has hit its stride, and a long track record of innovation, North Carolina is America's top state for business.

Since the study began in 2007, the Tar Heels have finished in the top 10 every year. Last year, the state finished in second place. It has never been able to climb to the top.

The difference this year was made by what. State leaders are able to put aside their political differences to boost the economy.

North Carolina Governor Roy Cooper speaks to the crowd during an election night event for Democratic Senate candidate Cheri Beasley on May 17, 2022 in Raleigh, North Carolina.

State Senate President Phil Berger and House Speaker Tim Moore were close to the governor when he signed a deal with VinFast to build a $2 billion factory in the state. The three worked together to come up with a package of incentives.

Berger said thatVinFast's commitment to North Carolina solidified their position as a global leader for fostering innovation.

The trio had worked together before. In exchange for as much as $846 million in incentives, Apple decided to build its first East Coast hub in the state.

When we work together, this occurs. Moore said at the event announcing that deal that it was what happened when people with different viewpoints came together.

The great seal of North Carolina is seen outside the state legislature building in Raleigh, N.C.

Cooper said that the election was difficult. I was trying to get rid of them. The same thing happened to us. We looked at each other and said that the people of North Carolina had voted for something. We have to get positive outcomes for our state.

Cooper and the General Assembly passed a two-year state budget last fall, the first comprehensive spending plan since Cooper took office. The adjustments for the budget's second year were signed into law by the governor on Monday. Expansion of Medicaid has been a bone of contention for as long as Cooper has been in office.

Alexander H. Jones wrote in Politics North Carolina that divided government is working in the state. Cooper and the Republicans have collaborated.

According to the CNBC study, North Carolina is the cornerstone of the nation's top economy. The state's credit rating is good. Government statistics show that economic growth and job growth were among the strongest in the nation.

There is more to come from North Carolina.

The state is second in access to capital. Bank of America and Truist Financial are the second and sixth largest banks in the country, and both are based in Charlotte. According to the National Venture Capital Association, North Carolina companies attracted some $3.5 billion in venture capital investments last year. State grant and loan programs for business have been resuscitated.

The home of the Research Triangle Park finished in the top five. The state of North Carolina has institutions that receive funding from the National Science Foundation and the National Institutes of Health.

Dale Earnhardt Jr, driver of the #88 Hellmann’s Fridge Hunters Chevrolet, looks on during practice for the NASCAR Xfinity Series Call 811 Before You Dig 250 powered by Call 811.com at Martinsville Speedway on April 07, 2022 in Martinsville, Virginia.

The state of North Carolina is ranked 12th for workforce. That is a key attribute for NASCAR driver and NBC Sports analyst Dale Earnhardt Jr., who is a small business owner as well.

He said it was easy for them to get some of the most talented people to work for them. Great people are needed to win. We have that opportunity in North Carolina.

Where North Carolina falls short

There are no perfect states. The state of North Carolina is ranked 28th for life, health and inclusion.

After intense criticism from businesses, the state retreated from its controversial "bathroom bill". The law requiring people to use the bathroom that corresponds to the gender on their birth certificate was repealed by the legislature. In 2020, the rest of the law expired.

According to the National Conference of State Legislatures, North Carolina is one of only five states that don't have a law to protect nondisabled residents from discrimination.

Public health spending and hospital resources are two metrics that the state lags in. North Carolina's rapid growth is straining resources.

Workers weigh heavily in rankings

All 50 states are measured by the CNBC study for a total of 2,500 points. The crown was captured by North Carolina with 1,590 points.

Each category is assigned a weight based on how frequently states cite it as a selling point.

The Workforce category will carry the most weight in the year 2022. The category has been retooled to better measure skills like industry-recognized ones as companies look for states with a ready-made workforce.

Drone Aerial of Downtown Charlotte, North Carolina, NC, USA Skyline.

Tom Stringer, managing director of the national site selection practice at BDO in New York, said there is a need for people who have the ability to work with their hands but also use technology to fix things.

The categories and point totals are here.

  • Workforce: 410 points (16%)
  • Infrastructure: 380 points (15%)
  • Cost of Doing Business: 345 points (14%)
  • Economy: 325 points (13%)
  • Life, Health & Inclusion: 325 points (13%)
  • Technology & Innovation: 250 points (10%)
  • Business Friendliness: 200 points (8%)
  • Education: 165 points (7%)
  • Access to Capital: 50 points (2%)
  • Cost of Living: 50 points (2%)

The runners-up

Washington is this year's runner up. When the study put more emphasis on business costs, the state dropped out of the top 5. Washington's strengths are reflected in the renewed focus on workforce.

There's a lot of science, technology, engineering and math workers in the state. According to the Bureau of Labor Statistics, one in 10 Washington workers make their living in those key professions.

Companies and families are vulnerable to inflation due to high costs.

Third place is Virginia. The Old Virginia became the first back-to-back Top State for Business in 2021. Census figures show that net migration to the state among college educated workers has slowed.

Colorado finished in the top four on the strength of America's top workforce. Colorado workers are the second most educated in the country, according to the Census Bureau. The cost of doing business in the state is hurt by the high wages of those workers.

TexasRounding out the top 5 is. The Lone Star State has never finished outside the top five in its history. Texas is growing fast as companies and people flock to the state.

They are finding a lot of problems when they arrive.

Researchers at George Mason University say that Texas has a bloated regulatory regime. That hurts the state's rankings.

There aren't many options for child care for residents. The state has the highest percentage of people without health insurance. There is no anti- discrimination law for nondisabled residents in Texas. It is chipping away at inclusiveness.

Texas is one of the most difficult states to vote in due to the deeply controversial election law that went into effect this year.

Texas finishes at the bottom of the list for life, health and inclusion. The state is in the top five because of its many other strengths.

State movers and shakers

Oregon is the most improved state. The state finished at 18th. The CNBC study emphasizes workforce over costs in Oregon. Following the worst of the Pandemic, the state's economy rebounded quickly. The gross domestic product contracted in 2020 but rebounded last year.

Other improvements include Kentucky, which rose 15 places thanks to improvements in its workforce and economy scores. The Green Mountain State is considered to have state support for emerging industries.

Connecticut and Maryland each fall fifteen places. For the first time, the states consider cryptocurrencies mining in the Infrastructure category.

New Jersey dropped 16 places and finished 42nd. America's least healthy pension systems are included in the data that shows the Garden State is dead last in the economy.

Bottom states

There needs to be bottom states if there are top states.

Mississippi is this year's last placefinishing state.

It's possible that you get what you pay for when you live in the Magnolia State. The Census Bureau says that Mississippi's workforce is the least educated in the country. In terms of economic output per job, it's the worst.

Some of the most restrictive voting laws in the nation are hurting Mississippi.

Abortion rights demonstrators gather outside the US Supreme Court in Washington, D.C., US, on June 24, 2022.

Although Mississippi is at the center of the abortion debate with the restrictive law that the Supreme Court upheld, this year's CNBC study did not consider abortion laws. Businesses have a stance on whether the laws will be a factor in their location decisions.

What is your state's ranking? Let us know what you think by using the #TopStates on social media.

CNBC is owned by NBCUniversal.