Braggin is often that- a lack of self confidence, OFTEN...
But usually it's overcompensation for some quality or material thing.
I've always been a talkative yet humble person, so in my case when I "brag" now, it's because I actually have things to brag about - just swinging my ego...and my big dick hahah

Even now though I don't find myself
bragging per se, but more expressing who I am - I agree that people who brag a lot are unattractive and hiding something.
Your small dick argument might work for some people, but on the whole as a generalization it is most definitely flawed.
Also - your post really sound like some PSYCHOANALYSIS - ain't that some "bullshit"?
I am trying to remember a quote by someone about NOT doing what you're not meant to do even if you can do it perfectly, and just doing what you're meant to do.
On a primal level we could have our ranked places - if you look at someone who is happy without many/any complexes, then look at their behaviour in a group, then if you're intuitive you will easily see what level they are at - alpha down to omega.
It's an uphill struggle to be someone you weren't meant to be, but it's possible, and it can even make you happy - it's just going against the grain. It's better to just be who you were born to be.
The one thing I find great to watch(I guess is because it's also where I am at), is when someone is rising through the ranks - going for the alpha spot - it's a very funny thing, animal group dynamics.
Personally, in slightly larger groups, I'm quite high - usually beta, occasionally alpha, but with groups who I'm very well associated with I am never alpha at the moment. Lower ranks or beta MAX (ba-dum-tsssss), in bigger groups I never even try anymore - I know naturally as I progress I will rise up with the need for competition until the very last minute, even then probably not much - I will use pure intellect.
I would be higher up already, but I became a lone wolf, so it's naturally harder to rise in ranking, plus in doing so I put myself down to omega status all the way, in order to understand what it was like to be poor and the underdog, that everyone shits on and takes their tension out on - it's not very nice, when it's not your natural ranking! But it's most definitely a humbling experience. I have much better understanding on a purely primal level, which still accounts for a lot with a great part of the population.
It's when it comes down to groups of

r less, that I am always either the alpha, or possibly the beta if I'm having a bad day - it's a strange thing to become aware of - shifts in social standing.