By the Grace of God (Latin Dei Gratia, abbreviated D.G.) is an introductory part of the full styles of a monarch historically considered to be ruling by divine right, not a title in its own right. In the United Kingdom, for example, the phrase was added to the royal style in 1521 and has continued to be used to this day. According to the "Royal Proclamation reciting the altered Style and Titles of the Crown" of May 29, 1953, the latest such change of royal title, Elizabeth II's present full title is
Elizabeth II, by the Grace of God, of the United Kingdom of Great Britain and Northern Ireland and of Her other Realms and Territories Queen, Head of the Commonwealth, Defender of the Faith.
In other Commonwealth realms, variations of the style are used, specifying the realm in question and varying some of the other elements of the title.
Originally, it had a literal meaning: the divine will was invoked—notably by Christian monarchs—as legitimation (the only one above every earthly power) for the absolutist authority the monarch wielded. This is also known as the divine right of kings, that is, the endorsement of God for the monarch's reign.
While the Christian Roman emperors during the late Dominate, especially in the East (as continued in Byzantium after the fall of Rome), came remarkably close to acting out the role of God's voice on earth, centralizing all power in their hands, e.g. reducing the Patriarch of Constantinople to their "(State) Minister of the Cult" and proclaiming their "universal" authority (in the Oriental tradition, as in Persia, but also in the original Muslim Caliphate), for most dynasties it would rather prove to be a never-ending battle up the hills of political resistance, both from rival power poles within their state (nobility, clergy; even within a dynasty) and from foreign powers claiming independence or even hegemony, usually constraining them in constitutional limitations (not necessarily written statutes, more often a matter of customary law and established privileges).