Content available vary from site to site

I thought that only the SRD content was supposed to be offered for free but on some website I can found content from the basic rules document or even the xanathar’s guide to everything book.

I usually classify sites that offer such content as piracy but there is some sites that I think to be legitimate. Here is two sites for instance :

  • dndbeyond with basic rules content on their character builder (subraces, bakgrounds…) or their data (wood elf from the basic rules : https://www.dndbeyond.com/races/elf#WoodElf)
  • aidedd.org with spells/feats/invocations from XGTE but not magic items nor monsters (eg : https://www.aidedd.org/dnd-filters/feats.php)

Do you know why we can found such content on theses website ? should I consider theses website legitimate ? How can I know ?