Irony in the broadest sense is the reversal of expectation. O'Henry was famous for his use of irony, and the comic irony in "The Ransom of Red Chief" does not disappoint.
The story turns on irony. When the protagonists Bill and Sam kidnap Johnny, the son of the wealthy Mr. Dorset, they think getting the ransom will be easy money. They look down on the sleepy town where the Dorsets live as backward, and they think Johnny will be no problem to handle.
The irony is that little Johnny turns the tables and ends up terrorizing Bill and Sam. He attacks them with a brick and a hot potato and threatens a scalping. Playing the role of the Indian Red Chief, he acts as the kidnapper and ties up Bill. Instead of being frightened at being kidnapped and held in a cave, Johnny finds it all a thrilling adventure.
Bill and Sam are quickly reduced by Red Chief to exhaustion and terror. Their goal becomes getting rid of Red Chief rather than getting a ransom. In an ironic reversal at the end, the twosome pays Mr. Dorset to take their son off their hands. They find out, ironically enough, that the town of Summit is filled with wily characters and that taking care of a lively child is no piece of cake.