I thought that only the SRD content was supposed to be offered for free, but on some websites I can find content from the Basic Rules document (that isn't in the SRD) or even the Xanathar's Guide to Everything book.
I usually classify sites that offer such content as piracy but there are some sites that I think to be legitimate. Here are two sites for instance:
D&D Beyond with basic rules content on their character builder (subraces, backgrounds) or their data (wood elf from the basic rules - there is even a footnote on this webpage: "Basic Rules, pg. 21")
Another site [name removed by a moderator to not endorse piracy sites] with spells/feats/invocations from XGTE, but not magic items nor monsters
Do you know why we can find such content on these websites? Should I consider these websites legitimate (i.e. non-piracy)?
How can I know?