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