Mastodon in comparison is far from perfect too, be it for very different reasons. Lacking billions in investment money, this open source project has always been an underdog. It lacks basic features like quote posting, the default UI is pretty ugly, and development is slow with a mostly volunteer developer base.
There are better open source solutions, but for whatever reason Mastodon became the most popular in the 'fediverse'. This term encapsulates both a protocol and an idea.
The protocol is ActivityPub, a web standard (by the W3C) for different services talking to one another. This and the fact it is open source makes a crucial difference from the many Twitter alternatives that have come and gone over the years.
A social network can only succeed by establishing a network effect: you join it and stay on it because you want to follow the people that are on the network. For me, I've been struggling in leaving Twitter (yeah, fuck 'X') as the (nuclear) energy community is mainly on there. Some have created a Mastodon account, like @Angelica, but haven't maintained a presence and just returned to Twitter where they have their biggest audience. I don't blame them. For as long as Twitter exists (see earlier notes on the death spiral though), I can see why people wouldn't want to invest time and energy in establishing a decade old social circle.
This is where ActivityPub shines: Threads of Meta has launched a year ago and, because it builds on an existing Instagram network, can sport hundreds of millions of users. I don't think it's a very special platform and Meta isn't any kind of better alternative to Musk in regarding its users as unwilling sources of income.
But it has been implementing ActivityPub for the past year. Very, very slowly, but still. Every other month or so they announce another 'breakthrough' beta feature in implementing the fediverse. And this is good, as it means that the Mastodon community potentially gets access to a lot more people.
I'm convinced Meta has been doing this for their own interests: the EU has been investigating Meta's dominsnce for a while now and they're moving to an open internet for all users, irrespective of platform. Meta is merely implementing ActivityPub to keep ahead of the game and remain in a position where they can make a first move.