How does the Elo work in chess.com?


They most likely won against higher rated opponents, therefore gaining a higher rating, while you likely win games against lower rated opponents, resulting in a lower rating than those other people.

When creating an account, you choose a skill level and that translates to an initial rating.
The site then uses the Glicko rating system, which includes a measure of rating uncertainty called the rating deviation (RD) value. Accounts with few games in a pool will have a high RD value and will see big rating swings. As more games are completed, the RD drops and the magnitude of rating change will as well.
So, it's possible you saw someone with a low initial rating and they won enough early on to get higher, someone that chose a higher skill level and lost some early games, or someone that was note accurate initially and maintained the rating.
https://support.chess.com/article/210-how-do-ratings-work-on-chess-com