That is because at this moment there are three Neils on the battlefield. There is the one who is going to reverse his entropy to save the Protagonist and Ives; there is the one who, with normal entropy, is driving a truck to save Ives and the Protagonist; and then there’s the one who’s already done that, and reversed his entropy again and who is now going to open the door that will be blocking Ives and the Protagonist’s way. Since he already knows they saved the world, he knows exactly what he needs to do.
“I’m the only one who can get that door open in time, right Ives?” Neil asks at the linear end of the movie. “I don’t know a locksmith as good as you,” Ives cracks back. Boom. It’s a temporal pincer movement within a larger temporal pincer movement. And since this is happening concurrently with the opera house siege in Kiev that means there are technically FOUR Neils chewing bubble gum and kicking ass. (Does your head hurt, yet?)
When we see the climax of the film play out in the missile silos below, we are watching the events from the Protagonist’s point-of-view, which means time is flowing in the natural direction. It’s why when he gets there, a masked Blue Team member with a backpack attached to a red string and tag is already dead on the other side of the locked door. That is Neil’s corpse, which means, speaking strictly from a linear perspective, this is the last time we see Neil in Tenet: a martyr who’s taken a bullet for his buddy the Protag.
However, since the dead Neil had his entropy reversed yet again, he dies while moving in reverse. It’s why we see him rise up and take a bullet for Neil while opening the door to the missile silo, allowing the Protagonist and Ives to get in there and claim the Algorithm. But in reverse, it looks like Neil has risen from the dead to open the door for our living heroes—a ghost from the future.
The Protagonist puts this altogether at the linear end of the film when he, Ives, and Neil are discussing what to do with the pieces of the Algorithm. Neil rather knowingly gives his share of the Algorithm to the Protagonist before announcing he’s going to go back into the past for another pass with reversed entropy.
“It’s me in there, again,” Neil says, “weaving another past in the fabric of this mission.” It’s unclear whether he knows he’s about to die, but by spotting Neil’s backpack, the Protagonist realizes in this moment it’s his newfound friend who died down there in the tunnels and also saved his life in Kiev. He asks Neil if they can try to do things differently—implying to Neil that he’s about to die. But like a good Tenet man, Neil refuses to tempt fate by trying to change it.