Because the messages were getting to be further and further apart
This is usually the case for me too. At some point maybe life just gets busy for either person, or someone loses interest.
I've also have that situation in real life for years now, where after months one of us will text the other. I don't like it but I also don't want to say anything.
I think I also almost lost touch with another friend, but now we chat more often again.
To be honest, I was always left, sometimes rudely and suddenly, without explanations, sometimes with more politeness, some other times quietly. The first kind of leaving is the most fastidious, but I think that in this cases (especially when the contact is effectued by the other), the person was looking for something else and he was not so coehrent with himself or with the spirit of a pen pal. So, I always think it was better that way.
Did you inform your opponent that you won´t write back anymore or did you just "ghost" him/her ?
I think ghosting is one of the meanfulest actions you can do with somebody - let people alone with the reason and just don´t care anymore isn´t that nice.