What is the meaning of the ram and goat vision?


He said: “I am going to tell you what will happen later in the time of wrath, because the vision concerns the appointed time of the end. The two-horned ram that you saw represents the kings of Media and Persia.  The shaggy goat is the king of Greece, and the large horn between its eyes is the first king. The four horns that replaced the one that was broken off represent four kingdoms that will emerge from his nation but will not have the same power. Daniel 8:19-22
            The prophecy Daniel received spoke of two nations who would rule over Israel in the future.  The two-horned "ram" was the dual-ruled combined power of Media and Persia.  They defeated Babylon in 539 BC.
            Then another power, the shaggy "goat" of Greece, took over Persia in the Greco-Persian wars that lasted from 492 to 448 BC.  Greece took over Jerusalem in 332 BC under the power of Alexander the Great.  The death of Alexander in 323 BC left a vacuum in leadership filled by four Greek generals—Ptolemy, Seleucus, Cassander, Lysimachus--the "four horns" of the goat.
The power struggle of Jerusalem juggled between many powers until Rome locked it up in 63 BC.  Daniel received the prophecy to let the Jews know turbulent times were ahead, but God saw it all and knew exactly how it would all turn out.