Immaturity is an unhealthy way of being. It can cause us to act in self-defeating ways. Any behaviour that lowers our self-respect or dignity is immature. Examples are temper tantrums, not being honest about our feelings, doing things you KNOW are not good for you, and insisting on having our own way.
None of these things feel deeply good inside, but if we fall into a pattern, we can start to routinely act a certain way. Perhaps we end up behaving in a way that even we do not understand. It may stem from a desire to feel loved and accepted, but truthfully, all those negative patterns do is push away those we love and need the most.
If you are starting to recognise unhealthy patterns in your life, you may find that you feel better once you start talking about it to someone. Opening up can be the first step to freedom.