How it it that humans commit suicide? Shouldn't natural selection prevent it? Shouldn't suicidal tendencies get selected out of the population? Why havent they? Does suicide actually have an evolutionary benefit?
Well the one thing is that there will always be maladaptive and adaptive traits/behaviors(and both at the same time), because evolution and its consequences aren't some kind of like rational, or ethical, or stable, or even "true" thing-- they're just a kind of temporary strategy that "seems to work so far" with the only criteria being reproduction(a very low bar for "things working").
From the POV of evolution, the only problem with suicide is if everyone commits it. That's when it would be selected out. As long as only a few people commit it, it won't get selected out, because it's not occurring a one by one thing, it's occurring similar to murder in a bigger context than just one person's genes. Murderers never run out of murder victims due to natural selection right? It's just a constant feature of the world, as long as only a few people commit murder. It's kind of like that, rather than a "murder victim" gene that eventually goes away.
If you only look at genetic fitness, you can imagine just a really simplified game scenario where strong groups "win games". Let's put it that way. And if there's a group with a particular weak link, and that weak link that weighed down the group voluntarily dies turning it into a strong group of 9, that group will now be better off.
But then that begs the question, why don't governments just encourage suicide? Stuff changes at bigger scales. One it's a bad look, while suicide prevention is a good(enough, for most people) look. That's slowly changing in some EU countries who want to try the "compassionate dying" story.
Survival is about narratives that twist or obscure reality rather then depicting it as it is, because of how negative reality is, making reality bad for survival(reason why we are still a psychotic species after so long). But telling a story that's useful or sounds good, but isn't true, is generally good for survival.
Two it's bad for business(RTD countries struggle to make RTD profitable, it's so expensive to die there), because the sociological model is set up so that you benefit the species by existing(it's very hard for any 1 person to weigh the species down) but the species doesn't really benefit you because the structure of the species and world is pretty obviously dystopian. But it does benefit your genes, from the "genes-eye view". This is identical to how if you look at factory farms, you see a hellworld of animal torture, but the genes of these animals are (mindlessly) content with this.