According to Encyclopaedia Britannica, the divine right of kings was used to justify their absolute right to rule, as their authority was supposedly derived from God. In other words, this doctrine stated that kings did not need to answer to any earthly authority.
Encyclopaedia Britannica notes that this idea became popular in the 16th and 17th centuries. Before that time period, the commonly held belief was that God granted monarchs temporary power. After this belief became popular, monarchs believed they held authority over the church and the population.
According to class notes from the University of Wisconsin-Madison, this doctrine was primarily used to reinforce obedience to the current government. It mostly fell out of use by the end of the 17th century, especially in England.