This is an issue of trust, expectations, and consent
... not of writing or campaign design.
Dungeons & Dragons runs on a social contract between the players and the DM. In my experience, one of the most (if not the most) common sources of table issues is simply expectation mismatches. Each player in a campaign (including the DM) comes to the table with a different set of unspoken expectations, and in many cases this is not a problem, but in times like this, it very clearly is.
One of the more important concepts in ttrpgs like D&D is "player agency." That is, the idea that the players gain narrative power over the game through their characters and those characters' interactions with the world. While the DM controls the world, the players control the party, and in cases where that assumption is broken down in a way that someone didn't expect, it causes problems. The rules exist to support this, by giving players clear and accessible ways of interacting with the world, and giving DMs the same ways of interacting with the PCs.
Make sure expectations are clear
Because of this potential for conflict of expectations, it's incredibly important to make sure that you know the players' outlooks on a given concept, and that they know your outlook on that concept. Whether or not you agree with respects to that outlook is another matter, but without being clear on these things, there's no way to even begin fixing the problem.
In this case, the scenario seems to be two differing (and opposing) points of view:
1. "If we lose an encounter, our characters basically die and the game ends. We may as well just fight to the death or play extremely conservatively."
2. "If the party loses an encounter, then that's just another way for the game and story to continue in an interesting way."
I would hazard a guess that your group's outlook comes from some bad experiences with DMs who had that expectation, burning them on the concept of surrender as a result. If not, it may simply be a misconception. Regardless, I suggest the same course of action.
Get on the same page
Talk to your players about this, either before the game, after the game, or at another time. If possible, it may be helpful to use something like the Same Page Tool as part of this conversation (my group recently had a mismatch of expectations that led to a pair of unfun sessions for part of the party, and that's what we used to help clear things up).
When discussing this, hear them out about what they expect and what they want out of the game, and ideally, they should do the same for you. After all, you are all peers in the same goal: collaboratively having a fun game and making a fun story.
During this discussion, your goal should be not to convince them of your way, but simply to, as a group, get on the same page about what people have been expecting, so that everyone can then get on the same page about what they should expect in the future.
Finding common ground
If you can convince the group to adjust their expectations, then all should be well, and your job then is to simply not betray the trust invested in the DM seat by the rest of the players. If the group won't move on things, be it because they don't trust you enough, are uncomfortable with the idea, or still aren't clear on what's being discussed, talking it out some more may help. In an extreme case, the mismatch of expectations and playstyles may mean that the group is simply incompatible in that way, which would be a shame. But I think that it should hopefully be a fruitful discussion, because...
In this game, trust and consent are everything
I would like to challenge the frame of this question slightly, expanding it to a more broad topic of player–DM trust and the idea of willingly giving up agency.
My example for this will be the Horror genre and horror campaigns. There's a lot of material out there on how to do "horror" games, scary monsters, sanity mechanics, and brutal, punishing campaigns, but none of those things are, in the end, what makes a horror campaign scary (in fact they might detract from it, but that's a different issue entirely).
In the end, what matters is that agency is in a sacred mental box, something that the DM should not touch without explicit permission to do so. This is part of why rust monsters and similar creatures are so hated: thanks to D&D having such an emphasis on items, rust monsters can (and often do) outright remove a player's ability to have an effect on the game. In D&D 3.5 or 4e, a fighter whose sword has been rusted away may as well no longer be playing, because the game is simply too punishing without the proper gear.
But horror, as a genre, is heavily rooted in the loss of agency. A person can watch a horror movie and critique the cheesy effects, bemoan the hammy acting and action, and mock the "rules" of horror movies, and they won't be scared, because while it's a horror movie, it's not scary unless you allow yourself to be scared. People who enjoy horror movies go into the film willingly putting aside their thoughts that would reduce the horror. When a horror fan watches a horror movie, they want to be scared, and allow the film to scare them. They have, in a way, given the movie permission to scare them. A promise that they won't overthink or pick apart the plot to make it no longer scary, and in the end, they get a fun experience out of having willingly surrendered their agency to let the film take them for a ride.
A horror game is the exact same thing, only it's slightly more complex thanks to people having different expectations and lines they do not want to cross. Players willingly take less agency than normal, and allow the DM to throw them into situations where they are not in control.
The DM's job in a horror campaign is above all else, being aware of these lines and expectations, and being cognizant of the emotional states and comfort of the players. It's fun to be scared, but when "scary" turns to "emotionally-traumatic," things have gone too far, and the game needs to be adjusted (or halted in order to cool down, discuss, and fix). Any of the players (including the DM) can at any time withdraw that consent if something in the horror campaign gets uncomfortable, and making sure that people stay happy and on-board with the game is the first task of that sort of campaign.
With that said, how does that apply here?
When the party fights to the death and dies, that's something that happens on their terms, out of character. The rules state that certain things work in certain ways, the players are aware of it, and no agency has been lost (most of the time. Sometimes agency has been lost simply by starting combat, in cases like "and then a level 20 lich teleports in and kills all your characters without warning," which I have regrettably seen happen).
Surrender, on the other hand, by definition means handing their characters' fates to the DM. It's no longer something the players control, but something the DM is in charge of. "The party arbitrarily wakes up in a jail cell" plots have this issue, because it can be seen as representing a misstep on the DM's part, overriding the players' right to interact with the world through the characters and rules.
Like playing a horror game, PCs surrendering to their foes requires, at least in some way, willingly giving up agency. If they do not trust you to take good care of that agency and then give it back to them to continue the game, then they will not surrender (and if forced to surrender, will likely be frustrated by that turn of events). In contrast, if they trust you to do so, they will likely surrender more often because they know you're going to make it fun for them.
So in conclusion
Talk to your players about expectation, and work to garner a healthy, trusting set of player–DM relationships. Make sure you know the lines people don't want to cross and how much agency they are willing to hand over to you for the sake of supporting your planned plot developments. Once you do that, then I think this issue should disappear.
Overall, the biggest thing is just being on the same page with respects to what people expect out of the game.