What is he purpose of trophies?
They are the game's rating system, and work fairly similarly to the Elo system. If you beat someone with higher trophies than you, you will gain a lot, if you lose to someone with lower trophies than you, you will lose a lot. Roughly speaking you gain 30 trophies for winning an even game. It is more or less what the game uses to matchmake.
The other thing they affect is your arena. There are eight arenas in the game, and you start in Arena 1. The arena you play in dictates a few things, like how much gold and how many cards you get from a chest, and it also dictates which cards you can get. In the first arena you can only win a handful of cards, but each arena unlocks new cards. You can see this all if you click on the arena symbol on the main screen, it will also tell you how many trophies you need to move to that arena. Careful once you do rise up - if you go 50 points below the threshold, you get demoted.
So ostensibly, trophies are how good you are as a player, but, remember that isn't just about skill, it's also about how leveled up your cards are, and how leveled up your towers are. You should expect to roughly be at Arena X when your king level and cards are at Level X + 1. Note that a common level X is roughly equal to a rare level X - 2 which is roughly equal to an epic level X - 4.
So, to get to Arena 5, you'd expect to need King Level 6, common cards at level 6, rares at level 4, and epics at level 2. A good player might be able to push up to Arena 6 with such a hand, a bad player might be struggling in Arena 4, but, generally, that's how it works.