7 Whoever has ears, let them hear what the Spirit says to the churches. To the one who is victorious, I will give the right to eat from the tree of life, which is in the paradise of God.
This applies to the church, those IN Christ awaiting their transformation into spirit life as Jesus now has. If they are dead, they will be in the 1st Resurrection. If alive, they will be changed
in a flash, in the twinkling of an eye, at the last trumpet. For the trumpet will sound, the dead will be raised imperishable, and we will be changed. 1Cor 15:52
The other passage is about those still alive after the tribulation.
"Blessed are those who wash their robes, that they may have the right to the tree of life and may go through the gates into the city."
The verse continues, showing that there are two lives here. The saved within the city and those who are yet to accept God's salvation.
Outside are the dogs, the sorcerers, the sexually immoral persons, the murderers, the idolaters, and everyone who loves and practices lying.
What is apparently a very wicked bunch is a factual way of describing any who are not yet IN Jesus. We can note the striking reference to Rahab.
By faith the prostitute Rahab, because she welcomed the spies in peace, did not perish with those who were disobedient. Heb 11:31
in the same way was not also Rahab the prostitute justified by works when she received the messengers and sent them out by another way? James 2:25
Paul makes no attempt to disguise what Rahab did or was - she was a prostitute, but now a faithful saved prostitute. So it could also be for the murderers and idolaters etc. who will be offered redemption and the tree of life just as all men (and women) will be.
The benefit of 'eating the tree of life' is to have eternal life with God, as Jesus now has - raised, exalted, not able to die again. We can only gain access to the tree through Jesus - hence the granting of the right to eat. In Jesus alone, we have the right. We'll remember the tree of life was cordoned off to men after the 'fall'. In Jesus, the restriction is removed for those who accept Jesus' sacrifice for their sin.