I am attacked by players at a much higher level than me
Matchmaking is decided mostly by your trophy count. If a player with a Town Hall level 10 has very few trophies, he can be pitched against all sorts of opponents, but the system will initially look for low-trophy opponents at the same TH level before widening the scope.
The trophy range for matchmaking is wide, to make sure players can find opponents at all times. This works both ways: sometimes you get attacked by an overpowered opponent, and sometimes you get the opportunity to attack a village that's no match for you.
If the trophy level between you and your opponent was huge, it was probably a Revenge match. You can seek revenge players who have attacked your village by clicking the Revenge button in th e Battle Log. Attacking via this button skips matchmaking entirely, and can result in matches with a large difference in trophies.
We are working on ways to make it a bit more clear which attacks came via revenge, so stay tuned!