If I worked at the same company but lived in 2 states, why does W2 from first state have my full income, but W2 from second state only has what was earned in that state?

I'm not sure how to file these numbers. When I enter the numbers as turbo tax requests, it says I owe an additional 4% in taxes to the first state