2 Kings is set in Israel and Judah from roughly 850 BCE, when King Ahab dies, to roughly 550 BCE, when Judah is exiled to Babylon. It's a time of trials and tribulations—there's even a stretch where kings are continually assassinated and replaced by their conspirators, who are assassinated all over again. It's set in a place where the Israelites are trying to figure out how to balance their own religious traditions with the cultures and customs of the people surrounding them.
The authors of 2 Kings see the difficulties of Israel as stemming from rejecting the ways of their forefathers like David. The problems seem to center on getting involved in various foreign religious practices. They interpret this time period as being one in which Israel and Judah struggle to remain faithful to God—and fail. Despite the efforts of righteous kings like Hezekiah and Josiah, God winds up punishing Israel and Judah by sending nearly everyone into exile.