Capek was writing science fiction before it was an official genre, including themes like alien slavery, mass production, and atomic weapons. He dealt with a lot of social ideas, which was probably partly due to the fact he was living in Austria-Hungry/Czechoslovakia in the early 20th century. He also gets extra points for writing anti-nazi plays before it was cool.
So how did he invent the word robot? Well Capek was writing this play about mechanical men that were built for service
reasons initially, but before the play even gets to the final act they end up killing all the humans and taking over the world. The question was what to call these things? Capek credits his brother for thinking of the word robot, which is derived from the word robota in Czech, Slovak and Polish. Robota literally means "serf labor".
So how does this play, titled Rossum's Universal Robots or R.U.R., end? I'm not giving away the ending here, you greedy readers! You'll just have to read the play yourself.
Or look it up on wikipedia.