The main nutrient in bananas is carbs which change drastically during ripening. Unripe bananas contain a high level of starch with and some starch is resistant starch. Yellow banana contains much less resistant starch than green ones since the starch in a banana is converted to sugar during ripening. In fact, the resistant starch content of a fully ripe banana is less than 1%.
Resistant starch is a type of indigestible cobs that escape digestion and function like fiber in the body. It feeds friendly gut bacteria when it reaches the colon undigested. When the bacteria digest resistant stanches, they form gases and short-chain fatty acids (SCFA) which are vital for digestive health.
About 95% of these SCFA is then rapidly absorbed by the cells in the colon and used by the body for energy.
So although resistant starches will not yield as many calories as regular carbs during digestion, they may be transformed into SCFA that provide calories later.