Samuel Butler said this quote

It has been said that though God cannot alter the past historians can - it is perhaps because they can be useful to Him in this respect that He tolerates their existence.