Your two examples define two different ways of combining bananas and fruit.
In your first example Bananas are a type of Fruits as they have all of the features of Fruits as part of themselves as well as any features you decide to add specifically to Bananas. Were you to pass a Bananas object to a function you could pass it to a function expecting a Bananas or, as many programmers find more useful, you could pass your Bananas object to a function expecting a Fruits! (You could also define Apples, Pears, etc. and pass those to that same function!)
In your second example Bananas contain a Fruits and conceptually are not Fruits. With that concept you can not add to the features of Fruits as it is represented within Bananas. Those features are set when the Fruits class was created. You could, technically, access the Fruits within your instantiated objects of Bananas and therefor have access to the public features of Fruits as part of your Bananas object but were you to ever want to pass an object of class Bananas to a function that function would have to specifically be expecting a Bananas...not a Fruits. (Were you to then define Apples, Pears, and the like you could not pass them to your function as it only accepts Bananas.)
For that matter, in your first example you are CREATING a new function within Bananas while in your second example you are merely CALLING a function called eatFruit that already existed in Fruits.