Comment sections are often actually also the place where the gold is. Tons of authors find the answer to the problems that they were trying to solve in comments or they find greetings from other people doing similar things, or sometimes someone points them at some other person or group doing similar things. Other readers/viewers may find the answer to the question that lead them to read/watch the content in the comments. Or there's a TLDR or a correction there that's really useful.

Depending on the site and community, a comment section vs needing to find a way to email or phone or meet someone in person in order to give them something is often a make or break threshold for contributions. Sadly, it's often also the threshold for bad contributions.

But why do sites do it? Yes, like another commenter said, it boosts engagement. Both for the platform and the users. Creators and commenters and even lurkers.