Like this point is driven home in the book especially, which if you know my thoughts on the book you know that's saying something, mercy is continually presented as not just the thing both Erid and Earth need to save themselves, but as what sets Eridians and Humans apart from, say, astrophage and taumoeba. Astrophage is devouring the sun, so to speak, but it's not out of cruelty and it's never presented this way in the book. It's a microbe doing what microbes do. Taumoeba eats astrophage, but there's no mercy to that, and in fact they nearly doom two worlds multiple times over because they're just microbes doing what microbes do.
There's not even an evolutionary reason for it overtly stated in the book, unlike bravery and self sacrifice. While both the intelligent species in PHM have the capacity for mercy, it's framed less as an overt survival instinct and more of a privilege.
Mercy comes very easily to the Eridians, and it's not because they're intrinsically better, morally, than humans. It's because they have the luxury of mercy. They can afford to take their time, to select the best and the bravest and the smartest people who want to go, of doing everything they can to give them a way to come home. They have almost a century from when the book takes place (well over that, from when they first launched the Blip-A) before things get bad. Even when the mission goes horribly wrong, Rocky doesn't stay in Tau Ceti just out of despair, he stays because he can afford to take his time and try everything he possibly can. The Eridians don't just build Grace a biodome because he saved their planet and he's scientifically interesting, they build him a biodome because they're physically capable of doing it.
Earth does not have that luxury, they have to destroy ecosystems just to buy a few more months for the hail mary to work. They cannot perfect the coma bot, they can't add more food or make a bigger ship, frankly the only reason there's entertainment is because it was faster to pirate the entire internet than it was to select what they thought might be useful. It doesn't matter if Earth would or would not choose to build a biodome for Rocky if the roles were reversed, we physically cannot create a biodome of our own damn atmosphere, let alone Rocky's. The best we could possibly do is a shipping container sized space for Rocky somewhere where if it fails it won't kill everyone in a mile radius of it and then also Rocky. Earth does not have the luxury of extending that kind of mercy.
But even outside that context, both Grace and Rocky's various acts of mercy are the thing that save their planets. It's not their bravery or lack thereof. And none of this is presented as a moral failing or a moral success, or a result of something intrinsic to how either of them evolved beyond just being something the intelligent species of the book shares. I feel like part of the reason Andy spends so much time in interviews and such emphasizing that the Eridians are obligate carnivores and apex predators filling the came ecological niche as polar bears, that as far as I can tell do not have domesticated livestock and hunt for their food, is because the book spends a lot of time decoupling (white, western, sorry Andy your book's political) expectations of societal formation and survival from morality and intelligence. And Grace's last act of mercy, turning back for Rocky, serves as the book's way to decouple mercy from luxury.
As much as I like that the movie lets the scene where Rocky offers to refuel the Hail Mary breathe, emotionally, I can appreciate just how quickly Rocky made that offer in the book. In the book Rocky's barely invented the spaceball, he hasn't even made the xenonite tunnels yet. He's not saving the life of a close friend, he's saving the life of an acquaintance at best, someone he barely knows in comparison to where Rocky and Grace are at in the movie. And we all know how that act of mercy chain reacts into saving two worlds: Grace is alive long enough to spot the taumoeba outbreak and he has the fuel to turn back for Rocky (in the book version the beetle tanks are steel but in the movie they're xenonite so Earth is saved by this act of mercy, too) but that isn't the source of the mercy in the act of turning back. Like sunlight in photosynthesis, it's the catalyst.
And where that leaves Grace is: he's just been on the receiving end of humanity at its worst. He bore witness to and was the target of the blunt weapon humanity became when it was backed against the wall, with nothing else but survival to aim for. And he could've very easily come out of remembering that wanting revenge, in fact he did want to give Stratt a piece of his mind after he remembered. He could've come out of it thinking "humanity sucks, Erid was kind to me, they're the ones who deserve to be saved." But Ryland Grace, who's the farthest from humanity anyone's ever been, says "no, I'm human, too" and "no, humanity isn't only who they were in their worst moment."
Because the whole time, humanity didn't need someone who was brave. Humanity didn't need a hero, heroism isn't real. Sacrificing yourself, your well being, to help another is noble, but bravery and heroism has a way of overshadowing the chain of events that put you in that position (as apolitical as Andy likes to claim his books are, I don't think it's a coincidence that he wrote phm in 2020, whether he was conscious of and deliberate with adding all these theses about heroism or not). Humanity is maybe not morally okay to sacrifice Grace to save themselves, but at the very least they'll survive to atone for the sin later (by having Stratt bear them. Scapegoat). But it's specifically because Grace didn't sacrifice himself, that he wasn't brave, that he wasn't a hero, that we're able to see that raw deal for what it is. And it's because Grace is merciful that Earth and Erid both live. And Grace is merciful not because he's Grace, not because he wants to survive or because he will survive without what he's giving up (book Grace made it abundantly clear that he turned back to Erid fully expecting to die), but because he's a person.
And that's why at the end of the book, when Grace tells us he thinks humanity worked together and helped each other, he's not doing that out of blind optimism and naivete. He's seen the worst of what humanity (and yes, Eva Stratt is a standin for all of humanity) has to offer, but he's also seen humanity at its best and, despite everything, Eva Stratt and Ryland Grace both represent all of humanity, in all aspects both evolutionary and psychological. And they both work together and help each other, they work with people they by all rights shouldn't be able to work with (Stratt and Reddell, Grace and Lokken). At no point does the base need to survive override the ability to work together, and at no point do the actions taken by those who just need to survive override the ability to work together, either.
And that's why when Grace turns back for Rocky, that specific act of mercy is the only one in the book that is ultimately not born out of luxury.
Rocky refuels the Hail Mary and rebuilds its lost fuel tanks because the Eridians have the luxury of a biosphere capable of breeding a nigh unlimited amount of astrophage and a lithosphere capable of producing the miracle material of xenonite: it didn't matter how big the ship was or how much fuel they needed, that wasn't a limitation for them. Therefore, Rocky can be merciful with his fuel and materials, giving some to Grace won't hurt his planet.
Rocky saves Grace over Adrian (planet) because Eridians can survive, very briefly and it hurts like hell and causes a shit ton of damage but they can do it, outside of their environment at a fraction of the pressure they evolved to, while on fire.
Grace saves Rocky over Adrian (planet) because Humans can survive, very briefly and it hurts like hell and causes a shit ton of damage but we can do it, massive chemical burns and immense strain to our muscles as we lift well over what our bodies are usually capable of.
Rocky saves Grace with the taumoeba because he has millions of kilograms of it, literal tons of calories, and Erid saves Grace with the biodome because again, they are physically capable of making it.
But ultimately, what lets Grace turn back for Rocky without killing billions, what gives him that capacity for mercy, what saves two worlds is the beetles. Four unmanned spacecraft born not out of circumstantial luxury but out of the necessity of survival.
And that's why we can believe Grace when he says he thinks humanity worked together. Not because he's naive, not because he's cynical, but because he's proof that you do not need the luxury of abundance to be merciful.