A thorny problem in the interpretation of the book of Samuel is the chronology of chapters 16ff. As most commentators look at this section of the book, Saul gets rejected as king in ch.15 (as he had in ch.13), Samuel arrives in Bethlehem to anoint David in the first half of ch.16, David gets called to Saul's side to play soothing music to calm him, a David unknown to Saul shows up to fight Goliath in ch.17, and then Saul rewards David at the end of the chapter. Then early in ch.18, Saul keeps David in his court, which he'd already done at the end of ch.16.
Some people try to avoid the problem simply by saying there are multiple accounts that conflict with each other that were all spliced together by some complete idiot who didn't know how to compile a book to save his life. The problem with such a view is that the author of Samuel is extremely careful, with an overwhelming number of subtle hints here and there and with a fairly consistent unity of style. The sections of the narrative are constructed in clear patterns throughout, with thematic progression and careful literary skill on a much more global level than just with the details within each chunk. There may have been multiple sources for the book, but the author made them his own. He wouldn't have left things so ridiculously conflicting, all within a few chapters, that the common picture you get from modern scholars would result, with this haphazard arrangement of contradictory reports that some editor just threw together because he didn't know what to do with them otherwise. So what's going on in this section of the book?