Various states in United States have signed reciprocal tax treaties with their neighboring states. Reciprocal agreements allow residents of one state to work in a neighboring state while only paying taxes to their resident state. This simplifies tax for people who live in one state, but work in another by requiring them to file only one state tax return. You only have to pay taxes to the state where you live.
Some states do not enter into reciprocal agreements with their neighbors, due to which their residents have to file taxes for both states and make complicated adjustments in order to account for tax paid to the other state.
These states have reciprocal agreements: NJ with PA, IL with various states like IA, KY, MI, WI, IN with KY, MI, OH, PA and WI, NJ with PA, MD with DC, PA, VA WV etc. The list is big, and your tax preparer completes your return based on these details if you reside and work in different states.
It always helps to get professional help for preparing taxes unless you have thorough knowledge of all the rules and laws used for tax filing.