A king is a male monarch who rules a country or territory which is a monarchy. The person usually inherits the title and position. A king comes to power when the previous monarch dies, who is usually a family member of his, most likely a parent. Sometimes a person may become king due to the previous monarch's abdication, for example George VI (who became King of Britain after his brother decided to abdicate).
For most of history, most countries were ruled in this way, especially in Europe. However, most countries, such as France, decided to become republics. Some, such as the United Kingdom, still have a royal family. In some countries, people chose a new king from other people to decide from.
The wife of a king is called a queen. A woman who becomes a ruler because of inheritance is also called a queen.