The nexus is "where the work is performed" or "where the employee resides" and usually states have agreements with the neighboring states so it balances out.
https://www.njspotlightnews.org/2022/09/nj-remote-workers-ny...