Main Line
The Main line in a Go problem is a sequence of moves where each move is supposed to be the strongest answer. The strongest answer is the one making it as difficult as possible for the opponent. Making it difficult means increasing the probability that the opponent goes wrong, reducing his strongest moves to (that one) imaginative tesuji.
Chosing the equally difficult, yet longer, variation until death is also another way of increasing ones own possibilities (e.g. with ko) of survival.
Therefore the attacker has to chose the shortest route to kill (ceteris paribus - if all other things equal).
Of course, this is all very subjective. At the very opposite end of the main line, lies dying in gote. (See Get Strong At Gote on how to accomplish that.)
In practice no defender would like to play on (and lose options), once s/he had read out that the position cannot be held alive in any variation - except in more than disadvantageous, hopeless situations, aji not present (looking for a way to resign) and esp. in Blitz.