PA/NJ State Taxes

Live in PA, worked in NJ. I understand there is some kind of agreement. I'm not understanding how it works. NJ is saying I will be refunded xxx. PA is saying I need to pay xxx. Do I actually need to pay PA with essentially the cash I get back from NJ? 

 

Everyone mentions to process non-resident form first before resident form and there will be credits and such, but no one has mentioned what this actually entails. So I'm not sure if I have done something wrong and I shouldn't have to do anything else OR if this is correct and I can expect to PHYSICALLY pay PA with the refund Jersey sends me. 

 

Also being charged a PA penalty fee which makes me feel something is wrong.

 

Thanks