Animations can be given a persistence of some sort, that will cause them to reform and continue with their mission. This can be from powerful (usually forbidden) magic, the most powerful dedication of The Risen, a curse, or Lovigdril – The Enduring Form. Generally, persistent animations will reform after a period of time equal to 1 Long Rest. They will rematerialize and reform in the same place where they last stood.
Once animated, without any other influence or persistence, the animated corpse performs its mission until it is destroyed.
Fire or similar damage that kills a persistent animation will cause it not to rise again. If they are cursed, removing the curse will cause them not to rise again. For The Risen, only removing the purpose of their vigilance will cause them not to rise again.