A coalition government is formed when two or more political parties join together to form a majority in the parliament or legislative body, enabling them to establish a functioning government. This is often necessary in parliamentary systems where no single party has won an absolute majority of seats.