A "king's ransom" is an English idiom referring to an extremely large sum of money that is required to pay for something. It may literally refer to a ransom being demanded by kidnappers in return for the safe delivery of the person who has been kidnapped. This phrase may also simply refer to an item which costs an extremely large amount of money to purchase. The meaning of the phrase "king's ransom" comes from the exorbitant amount of money it would hypothetically take to buy back the freedom of a king who has been kidnapped.
It is not uncommon in English for speakers to use words and phrases that have more significant meanings than is immediately apparent from their literal meanings. Instead, these words and phrases, known as idioms, take their meanings from the ways in which they are used by speakers and understood by listeners. The meanings of idioms often evolve over time to the point where the expressions can be used in far different circumstances than their original usage might have entailed. One of these phrases which refers to a large sum of money is the phrase "king's ransom."
On an occasion of an actual kidnapping, where someone is taken by force by criminals, this phrase may be used if the ransom demanded by the kidnappers is particularly large. This is usually the case in kidnappings, since criminals likely wouldn't take on the risk of getting caught without the chance of significant recompense. As an example, someone might say, "That terrorist group is demanding a king's ransom for the return of that diplomat without any harm."
Of course, since kidnappings are rare, the phrase has evolved so that it may be used in much more common situations. In fact, it is generally used when someone selling something demands a high price. The item might be so expensive that only the richest individuals would have a chance to purchase it. For example, consider the sentence, "I would love to have a car like that, but the dealer is asking a king's ransom for it and it's out of my price range."
The phrase "king's ransom" gets its meaning from the kind of money that it would take to pay off the kidnappers of a king. Since the phrase emanated from a time when kings were often heads of governments, it makes sense that a king would represent the ultimate target to kidnappers. Even though the power of kings has dwindled over time, their figurative status gives the idiomatic expression its impact.