How much Elo rating you gain or lose is based on the difference in current Elo between you and your opponent. If they are much higher rated than you they will get very few points for winning, while you lose very few points for losing. But if you beat a much higher rated opponent you gain a lot of points while they lose a lot. In teamgames the Elo loss and gain is also based on the rating of your teammates. If the opponents are all ranked 100 points higher than you but all three of your teammates are ranked 300 points above them you are on the stronger team, so your rating will not increase a lot if you win.