I'm assuming you're referring to the evacuation of Buna. If so, those prisoners who did not evacuate were liberated by the Russians two days later. However, Elie and his father choose to leave with the officers and other healthy prisoners, & so end up at two more camps, Gleiwitz and Buchenwald.
Before the evacuation, Elie is hospitalized following a surgery on his foot, which was swollen for weeks. He had been unable to walk on it, & finally entered the hospital. He had been reluctant to admit that he needed medical attention, because the hospital was often considered a place to die, rather than get well. But he finally conceded, and the evacuation is planned while he is recovering. Elie and his father deliberate for days, agonizing over whether to leave with the others, or remain behind with those who cannot walk.
In the end, they decide to take their chances with the SS. It may seem foolish in hindsight, but one must consider that the Nazis often killed those who were too weak to work anymore. Elie and his father were terrified that if they remained behind in the hospital, they would be executed as useless. Unfortunately, they actually would have been freed two days later, but they made the choice that they thought would save their lives.