I think this is because npcs that spawn for a certain goal (e.g. barrow brothers spawn due to you interacting, jad monsters that spawn at the start of a wave) they despawn if you do not attack them for long enough (5 to 10minutes).
I hope that we get a longer timer or no timer at all before they despawn ^