The first Mirror of Twilight was one of the interplanetary portals created by the Parella by order of Bellum in the primordial days of Hyrule in order to summon its armies from across the cosmos. However some time after the Golden Goddesses purged Hyrule of the Druthulidi, Bellum retreated to the abyss of the Great Sea and fell into a deep sleep. At some point between this age and the Rise of Ganon the Mirror washed up near the Arbiter's Grounds in the Gerudo Desert.
After the battle at Hylia Marine, which sees the end of the Rise of Ganon and the victory of the Kingdom of Hyrule over Bongo's Dark Interlopers and the armies of Veran's Fairies and Twinrova's Gerudo, who coveted the holy Triforce for themselves, unable to deal with the prisoners of war with her kingdom in ruins, Princess Nylin Zelda I decides to hand them over for the five Gerudo Warlords. The Warlords sentence the prisoners for eternal imprisonment and banish them through the Mirror of Twilight, believing it to be the entrance to an endless void. Unbeknownst to the Warlords, by activating the portal, they accidentally modify its destination from Hyrule to the Realm of Twilight.
When a group of Bellum's Parella minions attempt to come to Hyrule from the original other side of the Mirror, they end up in the Realm of Twilight. Claiming that they were originally being summoned to Hyrule but have had their travel disrupted by the Warlords, they form an alliance with the Twili king Mizorant and later his son Zant and work with them to construct a new portal to invade Hyrule.
With the mirrors completed, the Twili and Parella march into Hyrule and nearly destroy the Zora Dominion. They are initially very successful in destroying the Domain until Princess Ruto shows up and pushes them back. King Zant orders a retreat, though Veran refuses to leave without her husband General Onox and becomes trapped in Hyrule after the portals are closed and destroyed.
When Veran finds the necessary resources to build another Mirror of Twilight in Labrynna, she approaches the then Princess Ambi with her proposal. After Ambi becomes Queen, Veran works with her to build the Black Tower: a giant monument created to power a Mirror of Twilight so that she could bring her own forces into Hyrule. The subsequent Labrynnian invasions of Crescent Island, Subrosia and Horon in order to secure labour and resources eventually attract the attention of the Kingdom of Hyrule and the Fairies of Tarm.
Eventually both empires lead an assault on Labrynna just as the Black Tower is ready to become operational. Veran is able to activate the portal and contact King Zant on the other side, who soon begins to assemble his armies within the Black Tower. The Twili occupy Lynna City and force both the Kingdom of Hyrule and the Fairies of Tarm into retreat. They then pursue the Fairies to the Tarm Ruins. After Veran is defeated and killed by Tarm, Zant orders his armies to flee through the Black Tower back to the Realm of Twilight.
After Lynna City had been destroyed and Veran's plans unveiled years earlier, the two Sages Impa and Rauru ascend the Black Tower and find the Mirror of Twilght active. There they discover the possibility that Majora might have been influencing events from the Realm of Twilight, and they leave Hyrule behind and enter the portal.
It takes 6 turns to build and costs 2000 rupees.
It allows the Twili to send armies from the Realm of Twilight to the Gerudo Desert and vice versa. Unless you control both settlements that have the gates however, the trip is only one way. So you'll need to take control of the Arbiter's Grounds as soon possible to create a highway between the two worlds for your armies.
This gives the Twili a very nice defendable 'home base' area which is really important since they cannot train or build anything in Hyrule other than resource generating structures like mines. You'll only be able to get new troops in your homeland. This also makes defending the Mirror very important as the inhabitants of Hyrule could decide to destroy all it and permanently seal you off from the world... or worse invade your homeland by storm and exterminate you.