Historical context matters. To understand the meaning of the book of Daniel, one needs to situate the text within the context of its composition.
While the book of Daniel recounts stories and visions from the life of Daniel during the Babylonian exile in the sixth century B.C., the text was not written, compiled, and edited as a whole until probably 167-164 B.C., when the Greek king Antiochus IV Epiphanes exerted control over Judah and persecuted the Jews.
The book, as it appears in the Catholic Bible, can be divided into three main sections:
1) Stories from the life of Daniel and his friends Shadrach, Meshach, and Abednego while they were at court with the Babylonian kings (1:1-6:29)
2) A collection of visions, recounted in the first person by Daniel, about the coming of the kingdom of God (7:1-12:13)
3) An appendix (in the Greek edition) which includes the stories of Susanna, Bel, and the Dragon (13:1-14:42). [see note 1 below]
William B. Nelson in his book Daniel (part of the Understanding the Bible Commentary Series) has proposed a four-stage process for the development of the text. In the first stage, stories about the life of Daniel and his three friends circulated either orally or in written form from the time of the exile until the second century B.C. Given their internal unity, chapters 4-6 likely comprised a single collection of stories written in Aramaic in the second century. Later, an author combined these chapters with additional Aramaic stories of Daniel, and then wrote an opening chapter and the visions of chapters 8-12 in Hebrew. Finally, an editor modified the predictions for the coming of the end times at the end of chapter 12. From this, it follows that the book of Daniel, both in its content and its present form, was largely a product of the second century B.C.
With this context in mind, it becomes evident that the book of Daniel was meant to offer strength and encouragement to Jews suffering under persecution during the reign of Antiochus IV Epiphanes. The suffering that Daniel and his friends undergo in the first part would have spoken profoundly to the Jews of Judah at this time. For example, in chapter 1, Daniel and his three friends are taken into the Babylonian court and required to eat pork. Rather than disobey the covenant, Daniel and his friends convinced the chief eunuch to feed them only vegetables. At the end of ten days, “they were better in appearance and fatter in flesh than all who ate the king’s rich food” (1:15). For Jews forbidden to eat pork under Antiochus, the meaning would be clear: keep firm to the covenant, and God will protect you from harm.
The visions of the end times recorded in the second half of the book also fall under the genre of apocalyptic literature and were meant to give hope to Jews persecuted by the Greeks in the second century. In chapter 7, Daniel recounts a vision of four beasts and the coming of the kingdom of God. Each beast represents a kingdom that rises and falls to the one after it. Among the ten horns of the fourth beast, a little horn came up that pushed away three of the other horns (7:8). This “little horn” was understood to be Antiochus. For Jews at this time, the next section of the text would have offered consolation and hope: the reign of this beast would be taken away from him, and dominion would be given to “the people of the saints of the Most High” (7:27). If the Jews could remain steadfast, the time of trial would be over and the kingdom of God would be established.
The authors of the New Testament would later reinterpret this fourth kingdom to be Rome, and the coming of the “one like a son of man” in 7:13 to refer to Jesus. While this interpretation is valid, one should consider the original meaning of Daniel in its context in order to provide a foundation for subsequent understandings of this fascinating text.
Understanding Scripture - indeed, understanding any historical document - requires knowledge of the time in which the text was written and an awareness of how that context influenced the text. It is no less true today than it was over two thousand years ago.
 The Prayer of the Three Young Men (3:24-90) also only appears in the Greek edition. While these texts were not included in the Masoritic Text, it is likely that they are as old as the stories in Daniel 1-6.