The Bible is not a single document without any repeats. The writers of the Bible many times borrowed from other books, making some changes, then including them as part of their book. The question is, why would they do that?
In the first example,
I used Microsoft Word to compare sections of the Bible. The words of the two portions of scripture that are exactly the same are in black type. The text that is in red underlined is one version, red strike through is the other.
Here are the dates some think the books were written: