It's all down to the concentration of sugars in the fruit. The ripening process of bananas converts the starch in the fruit into sugar so the older they are, the sweeter they will be. Furthermore, as fruits age they lose liquid so the ratio of sugar to water increases resulting in a sweeter, more potent flavour. They also soften with age, making them easier to mash and add to recipes.