Bananas and rice are both part of the BRAT diet, which alleviates diarrhea and provides essential nutrients that are lost during bouts of chronic diarrhea.