I don't think boasting is always a sign of low self esteem, but often it is.
It really depends on context: what is their intention for "boasting" - people always want to communicate something or want a certain type of response when they seemingly boast. If you know the person, you can figure it out for yourself - some people may be seeking validation, some want to be happy and excited and want people to be happy and excited with them (we are social animals and all that). But I think the subjectivity of the "boastee" - the person boasted to, matters as well. For example, my aunt has seriously low self esteem, thinks self esteem in anyone else is a major character flaw (is Irish!) so any time anyone says anything vaguely positive or factual on social media, all it does is remind her of what she doesn't have and she thinks they're boasting, full of themselves, "they think they're better than everyone else" etc etc. I'm always amazed when she shares these opinions with me, because I genuinely don't see what she does. Maybe someone posted a picture of a holiday, I'd be thinking "wow that place is gorgeous, I want to go there someday" and she'd think "they think just because they can afford a cabin in Svalbard for two weeks and speak Norwegian that they're better than me!" 🤷
Some people do come across as lacking in social skills and desperately seeking validation from others, and I always feel a bit bad for those people. They don't do it because they're happy with decent self esteem! So it's always a bit sad. I have one friend who messages me and asks me to like her newest Facebook profile photo because she wants as many likes as possible for her selfie. She always tries to hard to appear perfect, but her actual life compared to what she shows on social media, is a complete sham.
Also, I think like others have said, it's a way to share status - particularly those who started off with a low perceived status - that they're catching up or keeping up with the Joneses.
I "boast" occasionally on social media, but there's always a good reason (for me) and it is never about validation! Not in recent years anyway (maybe when I was younger or less secure it was!). For example, when my ds worked really hard for his exams, I wanted him to know how proud I was and what a huge deal it was, so I put a post on Instagram. Was it cringey? Maybe a bit, but he was chuffed. Did I think he was better than any other kid who did their exams? No! But he has ASD and ADHD so the revising was an achievement for him. Did I want responses from family and friends saying well done, that he's a great kid and I should be proud? Yes, absolutely! 