The story goes that in 1934, MGM's Louis Mayer was angry at Gable for some reason, and decided to "punish" him by making him film a comedy (directed by some guy named Frank Capra) for Columbia Pictures, then considered a "Poverty Row" studio that made low-budget movies. It Happened One Night, of course, was a smash hit, swept the Oscars and is regarded as one of the greatest films ever made.
That's the story, at least. More recently I've read that Columbia's reputation had improved by this point, Capra was already an established director, Gable wasn't being punished, and that he had no problem with making the movie.
So what really happened?
Capra's first choice for the male lead was Robert Montgomery, but Louie B. mayer refused to loan him out because he had plans for him to star in a similar "bus picture" for MGM. After missing out on Montgomery, Capra asked for Gable. Mayer was souring on Gable because his career was seemingly faltering and he (Gable) was making large salary demands. He lent Gable to Columbia for $10,000.
Source: A biography of Capra titled "Frank Capra: the catastrophe of success" by Joeseph McBride.