It is certain that each of the authors of the Bible was a prophet or someone who had the gift of prophecy. It is through this gift that the Bible was inspired as a true revealing of God and His purposes. The Holy Spirit speaks through chosen people who are His prophets (and not through committees taking a vote on what to say and do).
The Old Testament names three major prophets Isaiah, Jeremiah and Ezekiel plus Daniel, and twelve minor prophets.
The prophets foresee attacks on the Northern Kingdom inhabited by the ten tribes and on Judea of the tribe of Judah. It was foreseen that first the Northern Kingdom and later Judah would fall. They warn that exile will occur. Most of the prophets warning of impending disaster come from Jerusalem and the tribe of Judah.
Jonah and Nahum were exiled from the Northern Kingdom to Nineveh by the Assyrians. Tobit was also carried off from Naphtali in the Northern Kingdom to Nineveh. Hosea from the Northern Kingdom took refuge in Judea.
Ezekiel, Daniel, Haggai, Zechariah and Malachi were taken into captivity in Babylon. Jeremiah goes into exile in Egypt while Baruch his secretary goes to Babylon. Thus, there were as many prophets in exile as living in the land of Israel. Eight of the prophets lived in exile.
It was the prophets who actually got the people back from exile in foreign lands to return to Jerusalem and Judea. Haggai, Zechariah and Malachi return themselves to Judea with the first returnees from Babylon. These prophets are involved in the rebuilding of the Temple, and the reforming of Judaism for this new era of the Second Temple.