Frankl is very clear that survival in the camps was based primarily on luck. Most people who entered the camps died. There was little rhyme or reason in the camps, which meant that anybody, no matter how gifted or resourceful, could be killed at any time. There was no surefire strategy for survival.
That being said, Frankl does assert very strongly that having a purpose for staying alive made a difference between life and death. Frankl contrasted himself and others like him to the Muselmann, the name for the individuals in the camp who had already given up. They went around like corpses, waiting to die. Some of them allowed themselves to be beaten to death or deliberately ran into the electrified fences surrounding the camp. They had no hope.
Men like Frankl, however, still had hope and a reason to live. Frankl, for example, sustained himself with the dream of reuniting with his wife after the ordeal was over, while at the same time recognizing that the odds made it unlikely he would survive. He nevertheless did all that he could to up his odds because it mattered to him to survive. He connected with other prisoners, was able to get "in" with a guard, and did what he could to meet his own survival needs. He also, even in the camps, was able to appreciate the small moments of grace, such as when he and other prisoners marveled at a particularly beautiful sunset or when, in a train car, became joyous when they realized they were en route back to Auschwitz rather than an out-and-out extermination camp.