The two witnesses are two figures in the book of Revelation that jump out of the story and surprise everyone. A lot of people don't even know about them. They are two Jewish leaders that are preaching the Gospel to the people of Israel after the time of the rapture of the church. They realize they have been left behind, and for three and a half years they are preaching the truth to their own people in the city of Jerusalem. That is a future prophecy of what is to come and in the middle of that tribulation period, the Antichrist, the Beast has them killed and executed. They are lying dead in the street of Jerusalem for 3 and a half days. When we look at the description of them, they sound a lot like Moses and Elijah. They turn the water into blood, they call down fire from Heaven. That's what Moses and Elijah did and Moses and Elijah were the 2 witnesses that appeared with Jesus on the Mount of Transfiguration. Then the shock comes, after three and a half days, the Spirit of God comes into them, they are resurrected, they stand up on their feet and they are raptured up to Heaven.
Why would God do a mini rapture in the middle of the tribulation period? Because of his love, mercy, and grace. To let the people know that what had happened earlier can't be explained away. Shows them a rapture to help them understand what happened. It says to the people of Israel, I love you and I did this for you.