Automated tests produce their value after the code changes. Except for rare types of tests, rerunning a test before any code changes is a waste of time: it will find exactly the same bugs as before. (The exceptions, such as timing and stress tests, can be analyzed in the roughly same way. I omit them for simplicity.)
But a test will not last forever. At some point, the product will change in a way that breaks the test. The test will have to either be repaired or discarded. To a reasonable approximation, repairing a test costs as much as throwing it away and writing it from scratch3. Whichever you do when the test breaks, if it hasn’t repaid the automation effort by that point, you would have been better off leaving it as a manual test.