Right now, the best swimmer in the world is from France. It's pretty cool that he is peaking in front of his home crowd.
Perhaps the athletes get a bit more motivated to perform when they know their country will be the host. Some countries will also invest in athlete development many years before the games to field a competitive Olympic team.