The matchmaking system will try its best to match you against opponents at a similar trophy level as yours. However, sometimes the difference in the amount of trophies owned by you and your opponent may be rather large. To make the matches more fair, the amount of trophies lost and gained after each battle is adjusted based on this trophy difference.
If you're able to beat an opponent who has clearly more trophies, you will earn more trophies as a reward. Similarly defeating a weaker opponent gives you fewer trophies as a reward.