While looking for posts with the #degoogle hastag with my mastodon account, I realized that mixed in the hastag timeline there were posts to the !degoogle@lemmy.ml community, but not containing the hastag itself in the text.
I tried to look around, but In wasn’t able to find an explanation of how this is supposed to work: is it because of the name of the community that is the same of the hastag? Or is or because the hastag is “embedded” in the community itself?


No, this is false as far as I can tell. I am willing to be corrected by someone more knowledgeable but my understanding is:
Communities are implemented not as hashtags, but as special users who “boost” everything addressed to them. That is why Lemmy sometimes gets posts made on Mastodon that mention a Lemmy community. It doesn’t always look great: https://discuss.tchncs.de/post/45785836
So communities and hashtags aren’t the same thing. In particular, communities have moderators who can remove things or ban people. Hashtags don’t.
It is a feature of Lemmy that all new posts (not, AFAIK, comments) also get the community name added as a hashtag. This is what OP was seeing and serves to somewhat increase the reach of Lemmy posts. But you can’t follow microblog hashtags on Lemmy.