You would need to provide clear alternative ways to win.
Theoretically, the pc's could make the enemy flee, or convince them to switch side, or get them to surrender or whatever. But the rules don't tell them how, and the dm will decide on the fly if it will work, how it will work, and what success will look like. There are so many known unknowns that the strategy of 'talking to them' is massively risky. Whereas killing the enemies is clear, direct, actionable, and has measurable progress points. So of course the players choose that every time.