It's a pretty complex set of formulae that depends on a lot more than just each player's rating (at the time the game ends, not at the beginning of the game), but also on how long it has been since the last rating change (for each player) and how "consistently" each player has been performing at their supposed rating.
If you really want to look into it, Chess.com uses the Glicko Rating System; you can find information on it various places online. But basically, each of you have an RD value (stands for ratings deviation) which determines how accurate chess.com thinks your rating is. Low RD values for you lead to lower rating changes for you; a high RD value for your opponent also leads to lower rating changes for you. The reverse of each of these lead to bigger rating changes for you. Your RD changes over time and after every game based on its own formula, but it gets lower if you perform "correctly" and gets higher if you perform "incorrectly" or have a long time between games.
Does anybody know how Chess.com calculates the rating adjustment for each game? Like, I know it depends upon each player's rating coming into the game, but is there a specific mathematical formula used to calculate the adjustment?