Daniel 10-12 form a grand conclusion to the book of Daniel. That God has not forgotten his people is a major theme of the whole book, but these final three chapters present God as not only aware of the suffering of his people, but actively moving in history to defend them when the coming great crisis comes. The book of Daniel presents God as sovereign overall the nations, including the Persian and Greek Empires.
These final three chapters are the most detailed in terms of prophetic events in the Old Testament. This make for difficult reading because most readers are not aware of the history of the period after the exile other than a few major key historical points. Joyce Baldwin recommends we read Daniel 11 with the Cambridge Ancient History volume 7 in hand (Daniel, 184).
Because Daniel 11 is so detailed, most interpreters consider the chapter a prime example of vaticinium ex eventu, history written as prophecy. There are other examples of apocalyptic literature which use this method. For example, the Animal Apocalypse in 1 Enoch 85-90 is a theological interpretation of history leading up to the Maccabean Revolt. Like Daniel 11, the Animal Apocalypse tracks the relationship of the post-exilic community and the nations, including Persia and the Greeks.
The Animal Apocalypse is more detailed in the Maccabean period (1 Enoch 90:6-12). Like Daniel, a “great horn” grows on one of the lambs and rallies the sheep against the oppressors. But this is not the arrogant little horn of Daniel 8 and 9, the apocalypse likely refers to Judas Maccabees. In 1 Enoch 90:13-19 the sheep (Israel) battle the beasts (Gentiles in general, Seleucid in particular). The Lord of the Sheep intervenes in wrath; he strikes the ground with his rod and a great sword is given to the sheep to kill the beasts of the earth. This probably refers to the conclusion of the Maccabean Revolt, but it is highly exaggerated. Unless this “Lord of the Sheep” is Judas Maccabees, this history re-told is wrong. God or a messianic figure did not directly intervene in the revolution against Antiochus IV Epiphanies. Verse 19 is the key: “a great sword was given to the sheep.” This divine passive indicates a human agent was given permission by God to successfully make way against the Gentiles (cf. a similar divine passive in Revelation 6:4).
The text of the Animal Apocalypse seems to go beyond history at this point to a prophetic vision of a future judgment of Israel’s oppressors. God intervenes to judge the nations who have oppressed his people. In 1 Enoch 90:20-27 a great throne is set up in the pleasant land (Israel) and “he sat upon it,” implying the Lord of the Sheep who struck the earth with his rod. The Lord of the Sheep then judges the sheep and their shepherds. In verse 20 the books are opened and seven shepherds are punished for killing more sheep that they were ordered to (verse 22). These bad sheep and shepherd are cast into the fiery abyss (v. 24), the seventy shepherds are found guilty as well and cast into the abyss to the right of the house (v. 26, presumably Gehenna to the east of the Temple).
So the Animal Apocalypse is “history written as prophecy,” but it shifts perspective to a future divine intervention and final judgment which does not seem to jive with well-known history as the rest of the Apocalypse does. I would suggest this the same strategy as Daniel 11. The vision accurately portrays historical events concerning the Ptolemaic and Seleucid kings up to a certain point. But in Daniel 11:40-45 the ultimate fate of Antiochus IV Epiphanes is wrong, or at least, not quite right. Antiochus does not die in the way described, nor does the great prince Michael come to defend his people (12:1), the ones who sleep in the dust do not rise (12:2-3).
Although it is possible this is all propaganda supporting the Maccabean Revolt, I think Daniel 11:40 turns to a genuine prediction. Like the Animal Apocalypse the writer begins to look forward to God’s intervention in history to deal with Israel’s enemies in a climactic judgment which sends some to some to everlasting life, and others to shame and everlasting contempt (12:2). This is how apocalyptic histories work, allegorical yet accurate history up to a certain point, then the writer expresses hope for a glorious future.