So you're asking about an NPC who is prepared for your PC's attack, i.e. they can see it coming, but "not trying to fight", i.e. they have some narrative reason for not wanting (or not being able) to respond to the attack by hitting you back.
When is Hack and Slash not triggered?
Let's look at the text of Hack and Slash.
Hack and Slash
When you attack an enemy in melee, roll+Str. ✴On a 10+, you deal your damage to the enemy and avoid their attack. At your option, you may choose to do +1d6 damage but expose yourself to the enemy’s attack. ✴On a 7–9, you deal your damage to the enemy and the enemy makes an attack against you.
So if Hack and Slash is triggered, and you fail your roll, then the enemy must counterattack.
The "if" is very important. One of Dungeon World's core principles is "begin and end with the fiction". The rules should never force you into an action that makes no sense from a narrative perspective.
So if it would make no sense for a certain NPC to counterattack you (because they are in love with you, or they want to die, or they need you alive and unharmed for some ritual, or they are an extremely committed pacifist, etc.), and Hack and Slash would force them to counterattack you, that must mean that Hack and Slash was not triggered in the first place.
When they can't or won't resist
Let's go back to that first line again.
When you attack an enemy in melee...
"In melee" or "in combat" is a two-way street. If you are swinging your sword at someone, and they are not fighting back at all, you are not "in melee" with them. You're just beating on them. In this case, Hack and Slash is not triggered. It's the situation you described in your post:
You just deal your damage or murder them outright, depending on the situation.
When they don't need to resist
If you have no realistic chance of hurting a target with your attack in the first place, Hack and Slash doesn't trigger in that case either.
Note that an “attack” is some action that a player undertakes that has a chance of causing physical harm to someone else. Attacking a dragon with inch-thick metal scales full of magical energy using a typical sword is like swinging a meat cleaver at a tank: it just isn’t going to cause any harm, so hack and slash doesn’t apply. Note that circumstances can change that: if you’re in a position to stab the dragon on its soft underbelly (good luck with getting there) it could hurt, so it’s an attack.
It seems logical that you could extend this privilege to an NPC who is just so good at blocking or dodging that you have zero chance of actually hitting them. A tiny fairy zipping around at the speed of light, or an ancient warrior monk who's been practicing his defensive techniques for a thousand years.
So that's when Hack and Slash isn't triggered. But there is another possibility.
Creative Hack and Slash: How an NPC can counterattack without dealing damage
✴On a 7–9, you deal your damage to the enemy and the enemy makes an attack against you.
What, exactly, does it mean to say that the NPC "makes an attack against you"? Does that mean they have to hit you with their sword?
No. Going back to the text:
The enemy’s counterattack can be any GM move made directly with that creature. A goblin might just attack you back, or they might jam a poisoned needle into your veins. Life’s tough, isn’t it?
Any GM move made directly with that creature. GMs have a lot of moves, though not all of them can be made directly with the creature you just attacked. The section of the rules on GM moves echoes this:
If a player move (like hack and slash) says that a monster gets to make an attack, make an aggressive move with that monster.
Note that's aggressive, not damage-dealing. In fact, "deal damage" is just one of the twelve basic GM moves.
This opens up some interesting possibilities.
With a little creativity, the GM can make a move with the NPC that could still be considered "attacking" (i.e. engaging or interfering with you in a way that goes beyond blocking or dodging), but which doesn't actually deal any damage. Here are some examples:
- Use up their resources: The sailor knocks the sword out of your hands and it clatters across the deck. (The manual specifically mentions "temporarily losing your weapon" as an example of this move.)
- Separate them: The old monk blocks the blow with his staff, and simultaneously kicks you backwards into the koi pond. You're not hurt, but it's going to take a minute for you to get back on your feet, and meanwhile your teammates are going to have to try and subdue this guy without your help.
- Put someone in a spot: The wizard snaps her fingers, and suddenly you find that your limbs are frozen in place. "This spell lasts about twelve hours...so it looks like you won't be in time to save the village after all." She smirks. "Serves you right for trying to kill me. Of course, I could break the spell early..." She leans in close. "...if you tell me where to find the Amulet of Kasmar."
- Use a monster-specific move: Before you can blink, the spiderlord has tangled your sword arm in its sticky threads. (Move: enmesh in webbing)
You can see the benefit here: the NPC gets to actually do something besides standing there like a lump.
What if an NPC just wants to defend themselves without counterattacking?
As we established above, not counterattacking doesn't fit Hack and Slash, so Hack and Slash can't be triggered. But since the NPC is defending, we wouldn't expect the attack to just work, either.
The upshot of this is that when a player attacks this defending NPC, the players will look to the GM to find out what happens next. Which triggers a GM move. Unlike the counterattack from "Creative Hack and Slash", this GM move does not have to be "aggressive", nor made directly with the targeted NPC. So any number of things can happen at this point: the NPC could try to bribe you to leave him alone, new NPCs could arrive and interrupt, a sudden avalanche could threaten you all, etc.
From a narrative perspective, if an NPC knows that someone is about to hit them with a sword, then 99% of the time they should either fight back or run away. Other reactions are possible, but they shouldn't happen very often. If you find yourself dealing with this situation a lot, there may be something wrong with your NPCs.