Well exactly, if you grow up in an environment where you aren't really encouraged or where you're always found lacking then it becomes default and you genuinely think like that. People seem to think it's whining and because they have confidence, they think a lack of is just silly and can't conceive that some people genuinely think that about themselves because that's all you've ever known.
You may have successes, but you're taught from a very young age to be self depreciating about everything you do achieve and that pride in yourself or your achievements is not desirable, is not an attractive personality trait, you shouldn't do it, it's not that great an achievement, you should have done better. That you're wrong, you should have done this instead. That it's your fault if it has gone wrong.
You may gather the self awareness to realise and change that, or it may become a pattern through someone's life because they're generally treated that way and those that are different you are dismissive of because you 'know' that at some point they're going to find out about the 'real' you not actually being that capable at all and it's all going to come crashing down.
I'm dyspraxic, only diagnosed fairly recently, my mother despised the symptoms of it, I was constantly bollocked for being cack handed and clumsy, for not being coordinated, for being careless, for having my head in the clouds, for not being able to talk properly, for having no spatial awareness, for struggling with fine motor skills, for struggling with driving.
I tried so damned hard to not be those things, but I still was. As I got older I laugh it off, but that's a defence mechanism because I'm worried I'm going to get shouted at.
Add to that jobs where you're in a servient position, and you're treated like crap most days just because people can or relationships where you're treated like that by someone (else) who is supposed to love you, and actually you just believe that's who you are and what you deserve, genuinely.
I mean look at this thread for examples of people telling others what they need to do, how they're wrong and how they need to do this or that, how they think is wrong - with many you're preaching to the converted because they already know they're wrong.