The movie is loosely based on a novel of the same name by Pierre Boulle, which was inspired by real events during World War II. The story takes place in Burma (now Myanmar), where the Japanese army was building a railway line to connect Thailand and Burma. The construction of this railway line was a real event, and it's estimated that over 100,000 workers lost their lives during its construction.
The movie's protagonist, Colonel Nicholson, is a fictional character, but he's based on several real-life British officers who were involved in the construction of the railway line. However, the character's obsession with building the bridge is purely fictional and adds a layer of drama to the story. The real-life British officers were mostly concerned with surviving the harsh conditions and treating their fellow prisoners with dignity.