In a game, theme is the metaphor by which rules are understood and remembered.
A good metaphor lets us understand one thing in terms of another. A bad metaphor increases our confusion.
Making an abstract system function like a real world system people are familiar with helps manage complexity.
Using ideas and structures already familiar to the brain because it needed them in real life makes your game more comprehend-able and usable and remember-able.
The more complex a game is, the more useful a theme is, because there is more information for a player to manage. Many simple games don't need a theme, and adding a theme would make them less elegant and coherent.
Theme and mechanics can fit together well or poorly. Why is that? Just like it is easy for our brain to find faces in random arrangements of images, it is easy for it to find patterns it is looking for and already familiar to it. So mechanics are going to suggest some themes by virtue of how they function. If you aren't paying attention to what theme your mechanics are suggesting, and just add theme at random, you are likely to have a mis-match, and add a level of incoherence to your game.