Like most people who are my particular age and had access to the internet growing up, I spent a lot of time on internet forums. These small communities were usually run by one person, who set up the forum software on some free or cheap hosting provider. The forum software was free or cheap too, more often cheap than free. The premier software was vBulletin.

vBulletin 3.x
vBulletin was the best, but it was very configurable, and people often installed 3rd party plugins to add features. These plugins were often programmed by amateurs, who accidentally introduced security vulnerabilities. vBulletin sites were frequently hacked as a result. Also, once you chose vBulletin, you had to keep paying for the latest version, because if you let your site fall behind in versions, the chances were it would be hacked.
The other problem with vB and other forum software was the difficulty in preventing spam posts. There were expensive services like CAPTCHA and Akismet, but the average one-person-band forum couldn’t afford them. So forum administrators and moderators had a full-time job clearing the forum of spam posts daily.
Despite these challenges, forums flourished. Everyone made forums. Everyone who had the computer skill would encounter forums, see how great it was to have a little place to talk with your friends, and they would set up their own forum. Usually centered around some hobby, such as video games. Most were centered around a single game series, which the forum owner and their friends happened to be playing at the time.
I’m not being elitist when I say that forums collected the most interesting people. Chatrooms (such as those on MSN.com and AOL.com) were hopelessly packed with boring people. As were the comment sections at popular sites. Each forum was its own little kingdom run by the owner, and interesting people would gravitate toward the forum with the most chill vibes and interesting discussions.
Since the golden age of forums (roughly 2000-2010), forums have been in sharp decline. The primary reason is a generational effect, where those who frequented forums in that golden era are now in a different phase of life (adults with responsibilities, jobs, children, etc.) and no new users have come in to replace them. I’m unsure what the primary reason for this is, but I have some strong theories.
First, before leaving the forum scene for good, these older members seemed to become very hostile to new users. New users keep forums new and interesting, but older members shunned them, often for the same foux pas that they themselves made 10 years prior. This elitism drove out new users, and created stagnation. This could have been halted, but forum admins and moderators saw declining numbers, and were afraid to censor older members. Unfortunately, they were penny smart and dollar foolish, and they gave up the incoming masses in favor of keeping old, grumpy curmudgeons.

Hey “noobs”! Stop asking questions so our forum becomes completely stale and irrelevant!
Second, the rise of social media, aided by infinite venture capital money, created new and exciting platforms, with fancier user interfaces, mobile support, and generally a more polished feel. This coincided with those old forum members becoming productive members of society, and they quickly jumped onto whatever looked more professional and mature.
Another effect is the collapse of the paid forum software ecosystem. vBulletin allegedly fired their entire development team and rewrote the codebase to be more mobile-friendly, at the cost of alienating everyone with an existing vBulletin install, who no longer received timely security updates. Some of those fired developers created XenForo, but it’s more expensive and seems intended for professional software developers. Free alternatives like phpBB are terrible, and certainly require a computer science degree to set them up securely. Free forum hosting sites like Invision were bought out by Tapatalk, which destroyed the UI and turned every Invision forum into a microtransaction nightmare.

You must pay money to pin a topic, even if you’re the forum admin. Welcome to the Tapatalk experience!
A perhaps distant fourth (or so) effect is the downfall of the desktop as a platform. Smartphones gave people the ability to use the best parts of the internet (search and communication) without sitting in an uncomfortable office chair for hours. As the desktop was no longer something that needed mass appeal, it started to become more nerdy. Compare Windows XP to Windows 11 and you’ll see that Windows XP had a dedication to simplicity and understandability that modern versions of Windows simply do not. MacOS has done a better job of remaining simple, but MacOS accounts for 1/3 as many computers as Windows does.
One thing you’ll notice in all of this is: none of these things are fatal blows to forums as a concept. Forums are still a viable community medium, but we have to start from square one. The existing software from the past will not work (it’s too old, stuck in 2010), and trying to chase the latest trend (looking like Discord, acting like Facebook, video streaming like TikTok) won’t work either. Forums are a unique thing that worked in the past, and can work again.