Chapters 24 and 26 of 1 Samuel have uncanny similarities. Both narratives recount how David spared Saul's life even though the circumstances seemed to imply that God handed Saul over to David to be killed. In both situations David chose to trust God's righteous planning instead of using lethal force on God's anointed king.
Many secular scholars have a problem with the similarities between the two narratives. They choose to believe that the stories are fabrications of the author. Their low view of the Bible leads to this inevitable conclusion. On the other hand, those who believe the Bible is "God breathed" or inspired by God (2 Timothy 3:16; 2 Peter 1:20-21) have an opportunity to know the character of God in a deeper way. These similar events placed so closely together have a purpose. Perhaps their purpose is to open our eyes to the way God patiently and persistently teaches us through repetition.
Think of the times God repeats Himself in Scripture. I have some examples but I'm sure you can think of more.
When Scripture repeats, it is not a mistake. Most likely God was teaching his people a lesson that is of equal importance for us today!