3,000 years ago
Belialuin was a city populated by wizards and witches, who remained neutral during the Holy War between the Goddess Clan and the Demon Clan. It was a capital blessed with prosperity, where the superior wisemen of humanity lived. There, under the pretext of researching the ultimate magic, but really to serve as weapons against the higher ranking demons and goddesses, human children with aptitude for magic were experimented on as test subjects.
When a miraculous girl who possessed the Infinity power was born among them, the news soon spread in the realms of the goddesses and the demons and both parties tried to put the girl on their side to tip the balance of the war in their favor. The people of Belialuin opposed this, claiming that both the girl and her power were their property. However, against the wishes of her people, Merlin decided to negotiate with the gods of both clans, the Supreme Deity and the Demon King, and said she would follow the one who gave her the best blessing. Merlin somehow managed to deceive both gods to renege on them by accepting both blessings. Furious, the two gods unleashed their anger against Belialuin, cursing her with a fog of death for a thousand days and destroying it with a rain of fire and lightning. Merlin was able to escape unharmed, becoming the only survivor of Belialuin.
The Ten Commandments are aware of Belialuin's history and express shock that Merlin could be from there, calling her "that survivor" which implies some sort of great disaster befell it which only she survived.
Hunting for the Commandments for Meliodas, Zeldris locates Elizabeth and the other Sins with Merlin calmly greeting him, only for him to ask who she is and she reveals her true form which shocks Zeldris as he recognizes her as the "daughter of Belialuin" who was blessed by the Demon King and Supreme Deity, to the shock and confusion of the others as Merlin goes up into the sky with Zeldris to "negotiate".
There, Zeldris explains the full history of Belialuin as the "Capital of Wizards", which was neutral in the Holy War until a miraculous child was born with the strongest and most unique magic, Infinity, which was none other than Merlin herself. Both the Demon King and Supreme Deity heard of this and both sought to have Merlin join their side to tip the war in their favor and, against the wishes of her people, goes to talk with the two gods and says she join whichever one gives her a better gift.
The Demon King offered her knowledge of the Demon Realm's secrets and immunity to the brainwashing and possession of the Goddesses while the Supreme Deity offered her immunity to dark curses, including the Commandments. Somehow, Merlin managed to deceive both gods and make off with both gifts, infuriating both of them as they unleashed their wrath onto Belialuin and killed off all its inhabitants, leaving Merlin as the sole survivor.
King of Chaos arc
After resurrecting Arthur as the King of Chaos and being reprimanded by Meliodas for awakening a "possible monster", Merlin's backstory is further explained by the Lady of the Lake, who explains that Belialuin was the home of the "superior wisemen of humanity" who were researching into the "ultimate magic", but were in reality experimenting on human children with a natural affinity to magic, with Merlin being the most promising among them.
Merlin was a progidy at her very young age and had already surpassed most of the wisemen in talent and wit but was a child at heart who wanted her father's love and acceptance, but he didn't return any love to her and only gave her tests to perform, making her consider her life at Belialuin the same as being imprisoned.
Hating her lifestyle, Merlin ran away from Belialuin with no goal in mind and a broken heart as she attempted to escape from the wisemen who attempted to retrieve her and was almost captured until Meliodas appeared and saved her and offered his help, making the little girl fall in love with him but he never returned these feelings. To win over Meliodas' heart, she used her magic to recreate herself as an adult but her hope was crushed when Meliodas introduced her to his lover, the goddess Elizabeth.
Overcome with heartbreak and anger, Merlin wanted to unleash all her hatred onto both of them but was ultimately unable to despise them, despite her grief. Seeing her hopes crushed, Merlin returned to Belialuin of her own volition and attempted to block out the pain by distracting herself with as much knowledge as she could but this didn't work and her days were spent troubled until she overheard about Chaos and its story, setting forth her goal of freeing Chaos from its seal to fill the void in her heart.
- The name Belialuin appears to be stemming from the term "Belial" (or "Beliar") that first occurred in the Hebrew Bible, and later in Jewish and Christian texts to refer to the Devil personified.
- In the DC Comics universe, Belial is also presented as the father of Merlin the Enchanter.