When the game is looking for an opponent for you, it's done according to your level and the strength of your castle to give both players a fair chance.