The baseless rumour that the prophet was slain in the field, as we said, frightened all Muslims, and they ran away from the battle-field, and even some of them thought to recant! This verse was sent down to admonish them that, firstly they should know that no one will die without permission of God. The lives of people are all a term fixed and recorded in a book. Even if the prophet was slain in the battle-field it was not something unnatural, or in contrast with the Divine rules and regulations.
On the other hand, to escape from a battle is not to escape from death, so also taking part in a battle does not push forward the warrior's death. And this is also a fact that, one who takes part in a war, endangers only his own life, but he who escapes from the field, endangers the life of all the army!
The verse ends in that; the endeavour and efforts of man will not be wasted or blotted out. It merely depends upon the aim and purpose of the warrior: If he has a material goal, like the archers at Ohud who deserted their battle - posts for the sake of plunder, they might have got some booty; but they put themselves and the whole of their army into jeopardy. Contrary to these, are those who fight with firmness and full discipline for the cause of God; their reward is swift and sure. If they die they get the crown of martyrdom. And if they live, they are heroes honoured in this life and the next.