Historically speaking, Magog was a grandson of Noah (Genesis 10:2). The descendants of Magog settled to the far north of Israel, likely in Europe and northern Asia (Ezekiel 38:2). Magog seems to be used to refer to "northern barbarians" in general, but likely also has a connection to Magog the person. The people of Magog are described as skilled warriors (Ezekiel 38:15; 39:3-9).
Gog and Magog are referred to in Ezekiel 38-39 and in Revelation 20:7-8. While these two instances carry the same names, a close study of Scripture clearly demonstrates they do not refer to the same people and events. In Ezekiel’s prophecy, Gog will be the leader of a great army that attacks the land of Israel. Gog is described as “of the land of Magog, the prince of Rosh, Meshech, and Tubal” (Ezekiel 38:2-3). Ezekiel’s battle of Gog and Magog occurs in the tribulation period, more specifically in the first 3 1/2 years. The strongest evidence for this view is that the attack will come when Israel is at peace (Ezekiel 38:8, 11). The description from Ezekiel is that of a nation that has security and has laid down its defenses. Israel is definitely not at peace now, and it is inconceivable that the nation would lay down its defenses apart from some major event. When Israel’s covenant with the Beast/Antichrist is in effect at the beginning of Daniel’s 70th Week (also known as the 7-year tribulation, Daniel 9:27a), Israel will be at peace. Possibly the battle will occur just before the midpoint of the seven-year period. According to Ezekiel, Gog will be defeated by God Himself on the mountains of Israel. The slaughter will be so great it will take seven months to bury all of the dead (Ezekiel 39:11-12).
Gog and Magog are mentioned again in Revelation 20:7-8. The duplicated use of the names Gog and Magog in Revelation 20:8-9 is to show that these people demonstrate the same rebellion against God and antagonism toward God as those in Ezekiel 38-39. It is similar to someone today calling a person "the devil" because he or she is sinful and evil. We know that person is not really Satan, but because that person shares similar characteristics, he or she might be referred to as "the devil."
The book of Revelation uses Ezekiel’s prophecy about Magog to portray a final end-times attack on the nation of Israel (Revelation 20:8-9). The result of this battle is that all are destroyed, and Satan will find his final place in the lake of fire (Revelation 20:10).
It is important to recognize that the Gog and Magog of Ezekiel 38-39 is quite different from the one in Revelation 20:7-8. Below are some of the more obvious reasons why these refer to different people and battles.
1. In the battle of Ezekiel 38-39, the armies come primarily from the north and involve only a few nations of the earth (Ezekiel 38:6, 15; 39:2). The battle in Revelation 20:7-9 will involve all nations, so armies will come from all directions, not just from the north.
2. There is no mention of Satan in the context of Ezekiel 38-39. In Revelation 20:7 the context clearly places the battle at the end of the millennium with Satan as the primary character.
3. Ezekiel 39:11-12 states that the dead will be buried for seven months. There would be no need to bury the dead if the battle in Ezekiel 38-39 is the one described in Revelation 20:8-9, for immediately following Revelation 20:8-9 is the Great White Throne judgment (20:11-15) and then the current or present heaven and earth are destroyed, replaced by a new heaven and earth (Revelation 21:1). There obviously will be a need to bury the dead if the battle takes place in the early part of the tribulation, for the land of Israel will be occupied for another 1,000 years, the length of the millennial kingdom (Revelation 20:4-6).
4. The battle in Ezekiel 38-39 is used by God to bring Israel back to Him (Ezekiel 39:21-29). In Revelation 20, Israel has been faithful to God for 1,000 years (the millennial kingdom). Those in Revelation 20:7-10 who are rebellious are destroyed without any more opportunity for repentance.