I'm sorry for the loss of your little friend
It is most likely old age as the other people who replied said. I read a something or two online where a few people had a betta live almost 8-9 years. 4-5 years is usually the maximum age they get with proper, loving care as far as I have read.
He had a good life with you