When Robert Henderson's company moved from Pennsylvania to Delaware more than two decades ago, he had already settled into a home in Chester County. So he stayed put.

But commuting across state lines has cost Henderson, an engineer, thousands of dollars in the last 26 years because he must pay Delaware's personal income tax rate, which is higher than Pennsylvania's.

Someone who lives in Pennsylvania and earns $50,000 a year, for example, would pay an extra $21,000 over the course of 25 years by commuting to Delaware, rather than working in Pennsylvania.

"I've learned that it is always best to work in the same state you live in," Henderson said. "I do my own taxes, and having to deal with two states that tax income differently just complicates life."

Henderson submitted a question about commuting across state lines through Curious Philly, our forum that allows readers to submit questions about their community. He wondered why Pennsylvania and New Jersey have an agreement under which people living in one state and working in the other pay income taxes only in their home state, while Delaware doesn't.

Henderson is not alone. More than 324,000 people who live Delaware, Pennsylvania, or New Jersey, work in one of the two other states. Here's an overview of when and why it costs workers extra tax dollars to work across state lines — and when it might save someone some money to have an interstate commute. Those who travel into Delaware pay the most, while high-income Pennsylvanians who work in New Jersey are getting a deal by avoiding the Garden State's income tax.

What is tax reciprocity?

Pennsylvania and New Jersey have had a reciprocal agreement since 1977, when both states agreed that they would not charge income tax to workers who commuted from the other state.

The arrangement is advantageous to high-income Pennsylvanians who work in New Jersey and middle-class New Jersey residents who work in Pennsylvania. It affects nearly 250,000 people; about 125,000 Pennsylvania residents work in New Jersey, and almost the same number of New Jersey residents work in Pennsylvania, according to U.S. Census data.

Also in 1977, according to an Inquirer article at the time, New Jersey lawmakers hoped to make a similar deal with Delaware. It never materialized.

People who live in Pennsylvania and work in Delaware, such as Henderson, pay Delaware income taxes and can then claim a credit so they do not have to also pay Pennsylvania taxes on the same income. In the reverse situation, Delaware residents commuting into Pennsylvania would still owe money to their home state after paying Pennsylvania — but they'd owe only the difference between the Delaware tax and Pennsylvania's lower figure.

David Broughton, a Philadelphia-based senior tax analyst with H&R Block, said he gets a lot of customers who live and work in different states.

"When multiple states are involved, a lot of people don't know how to handle them," Broughton said.

Among the three states, Delaware has the highest personal income tax rates, and therefore would likely lose money if it did not collect from all commuters. Nearly 39,000 people commute into Delaware from New Jersey and Pennsylvania, while more than 35,000 live in Delaware and work in New Jersey or Pennsylvania, according to U.S. Census data.

Pennsylvania also has tax reciprocity with five states: Maryland, Ohio, Virginia, West Virginia, and Indiana. New Jersey, meanwhile, has reciprocity only with Pennsylvania. Delaware does not have reciprocity with any other state.

How does my interstate commute affect my bottom line?

It depends on how much money you make and where you live.

Pennsylvania's flat tax rate, compared with New Jersey's progressive rates based on income, is more advantageous the more you make. Working for a New Jersey company but living in Pennsylvania can save high-income households a significant amount. A Pennsylvania resident who makes $100,000 a year working in New Jersey saves nearly $1,200 a year by avoiding New Jersey income taxes.

New Jersey's rates, however, are less than Pennsylvania's for middle and lower-income workers. A New Jersey resident who makes $50,000 a year pays $265 less in income taxes than a Pennsylvania resident who makes the same amount. People who commute to Delaware, however, would pay at least $1,100 more than they would if they worked in New Jersey.

The break-even point, or salary at which Pennsylvania and New Jersey income taxes would be the same, is $60,800. People who make less than that would have a lower tax rate in New Jersey, and those who earn more would get a better deal on taxes in Pennsylvania.

Why did Chris Christie almost cancel New Jersey’s agreement with Pennsylvania?

Then-Gov. Chris Christie announced in 2016 that New Jersey would withdraw from the Pennsylvania tax agreement. But after facing criticism from lawmakers, business owners, and residents in both states, he reversed course and kept it intact.

New Jersey loses money in the deal; State officials have said that taxing Pennsylvania residents who work in the state would add $180 million a year to state coffers.

Citing that figure, Gov. Murphy vetoed a bill this year that would have required the Legislature's approval to end the agreement.

There were no votes against the bill in the Assembly or Senate, but Murphy said it would "weaken the ability of the state to adapt to extraordinary circumstances."

"The largest beneficiaries of the pact are upper-income Pennsylvanians who commute to New Jersey for work but pay Pennsylvania's flat income tax of 3.07 percent," he wrote in a veto message. "If they were subject to New Jersey's income tax, they could pay a top marginal rate of up to 10.75 percent."

New Jersey lawmakers who want to keep the agreement intact say its benefits include encouraging businesses to move to South Jersey and ensuring a lower tax rate for middle-class New Jersey residents who commute to Pennsylvania.

What about the Philadelphia wage tax?

Pennsylvania has a flat personal income tax rate of 3.07 percent. New Jersey and Delaware, however, have progressive rates; people who make more pay more.

Anyone who works or lives in Philadelphia also pays the city's wage tax — including New Jersey residents who are exempt from Pennsylvania state taxes under the reciprocity agreement. New Jersey residents can claim a credit for the Philadelphia wage tax against their New Jersey income taxes. Delaware residents can claim the Philadelphia wage tax as an itemized deduction, but not a credit, according to the state's Division of Revenue.

Other factors to take into account when considering a total income-tax burden including local income taxes:

Henderson, the Chester County resident who works in Delaware, for example, also must pay a 1 percent earned-income tax to the borough of Avondale, where he lives.