"I passed your test. Fate has a twisted sense of humor, it seems."
Loghain was born a farmer in a time when his country was under foreign occupation. While still a boy, he joined the resistance, where his tactical genius quickly became apparent. He became close friends with Prince Maric, the true heir to the Fereldan throne; together they led the rebels, driving out the forces of the Orlesian Empire. Maric raised his friend to the nobility; Loghain became a living legend, a symbol of the Fereldan ideals of hard work and independence.
He returned to Denerim and declared himself regent to his daughter, Queen Anora, demanding that Ferelden follow him against the darkspawn—upsetting many of the banns. His actions sparked a civil war. Loghain's supporters found themselves fighting their neighbors, who blamed Loghain for the death of the king, as well as those who wished to take advantage of the power vacuum. He was defeated in single combat at the Landsmeet, and sentenced to undertake the Joining ritual. He survived, and rejoined the fight for Ferelden as a Grey Warden.
If the Warden did the Ultimate Sacrifice...
Destroying Archdemon Urthemiel at the Battle of Denerim cost the life of the Hero of Ferelden, but in the aftermath Loghain remained to help repair the kingdom and the Wardens he had nearly destroyed.
If the Dark Ritual was done...
Together, Loghain and the Hero of Ferelden fought the Archdemon Urthemiel when it attacked the city of Denerim. They emerged victorious, having slain the creature, ending the Fifth Blight almost before it began.