That’s because it detonated in orbit, so it interacted with Earth magnetic field. Far from the planet, I think there wouldn’t be an EMP, unless the targeted ship has it’s own magnetosphere. But I’m not a nuclear physicist, so take my opinion with a grain of salt.
Thanks for the explanation, I learned something new today.