Arena rating comes from playing 3v3 or 5v5 arena matches at level 80. You need to be on a team, and you start with an initial rating — somewhere around 1000 — which everything else is measured against.
The swings depend on who you beat. Winning against a higher-rated team gains you a lot; beating a lower-rated team gains you very little. Losing to a lower-rated team costs you far more than losing to a higher-rated one.
Your team carries a rating too, calculated from the average gains and losses of its members. To buy the strongest PvP gear, both your personal rating and your team's rating need to clear a minimum threshold.