The different authors of the Old Testament, who are usually grouped into four writing traditions, all had different viewpoints and goals for their writing. One of these, the Deuteronomist tradition, is generally credited with the writing of the books of Deuteronomy, Joshua, Judges, First and Second Samuel, and First and Second Kings. Some of these books may first have been written before the fall of the monarchy, but they were finished and edited into their current form during the Exile. This means that the final redactors were putting these books together during a time of upheaval, when the Israelites have lost their government and their center of religion, and many had been forced to move out of the land which had been the kingdom. Because of this, the books of Deuteronomistic History attempt to both explain how the Exile came to be, but also to help the Israelites keep their faith and tradition while under foreign rule.
2 Samuel is one of the most important books in this attempt to keep tradition and hope alive.
The Second book of Samuel contains a number of stories and events that are extremely important to the goals of the