Mastodon was around for a while, slowly being built up until 2022 when the big twitter surge happened. They had the perfect foundation to make it the next big thing and all they had to do was keep the people who joined, make it slightly easier to join, and develop a few features like quote posts.
- They banned and defederated everyone who wasn't in a very narrow sliver of political and technological opinions.
Mastodon lost it's momentum, but had a second shot a year or two later. Threads joined the network offering a massive user base that could talk with Mastodon users. Then Bluesky blew up and that was bridged so Mastodon could talk with those people too. Mastodon may not have been the center of things anymore, but it could be fully integrated into the other two.
- Most servers defederated with threads and bridges.
There are other things that I'm sure play a roll as well. Luck, discoverability, easiness to join, people getting board, people looking at the next shiny thing, you name it. But it does look to be in many ways self inflicted.