The state of immaturity suggests something that has not ripened or is not fully grown. Applied to humans, it is the state of being less than fully-grown, or at least of acting in a childish or silly manner.
With the Latin word immātūritās meaning "unripeness," as in a piece of fruit that is not yet fully developed, we can see the meaning of the modern word immaturity. Nowadays, the word is applied more often to people than to fruit, usually in referring to foolish behavior. Although the word is most often used to refer to adolescent behavior, it can still be applied to a physical state of development. And of course, it can still be applied to underripe produce.