The OT probably began to be a written scripture in exilic times. Over time it became - amongst other things - a saga of the Hebrew people from the begining of the world to the time of the second temple. It was a vast undertaking, probably unprecedented in scale.
One problem was how to weave together slightly (or sometimes very!) different traditions and versions into a single story, and on the whole the editors and redactors did a good job, but there are still clear signs of the OT being 'cobbled' together.
The first and best known is gen 1 and gen 2, which are different accounts of creation, clumsily(?) linked by Gen 2:4. Just as well known is the ambiguity between the number of animals on Noahs ark - was it 2 of each, or 2 of some and 7 of others?
The story of Abraham passing his wife off as his sister appears 3 times, gen 12:10, gen 20:1 and gen 26:6.
There are 3 different accounts of Saul's ascent to kingship, and Goliath is killed by David in 1 Sam 17 and by Elhanan in 2 Sam 21.
2 kings 19 and Isaiah 37 are word-for-word identical chapters!
There are loads other 'doublets' in the text, even if you ignore Chronicles, because that was a later rewrite of the material.
More thorough analysts than me identified 4 'strands' (JED and P) which are intertwined in the OT we have today. I can't think of a good reason to doubt that is essentially true.