why did I gain 25 points?

Of course it does. That is how it works. The less you play, the bigger RD - rating deviation is, so you win more rating points for a win and lose more for a loss.
It is usually the case when you have a new account, but if you do not play for some time (a few months is certainly enough to see the difference) it is the same.
When you do not play for some time, the system doesn't have the means to see if you progressed a lot or declined, because you didn't play enough on your account.
For instance, you might be a very young person who studied and played chess for months, while not playing on your account. Now imagine you were at 1 500 and are now realistically 2 000 strength after a year. If you only win/lose 8 points, it will take a long time to get where you should be, and you will impact people who play against you as well (you will beat most people rated 1 500, and they will lose more points because it appears they are playing 1 500 rated person, while they are really playing a very underrated player).
Or perhaps you didn't play a single game in a year, and you are worse now than you were.
Basically, it is the way of the system to determine what is your current rating realistically and relatively quickly.