They are directly sourced from company websites or their ATS. I think it is unlikely that companies would list ghost jobs on purpose but it is likely that there will be some outdated ones.
There's lots of reason why just going off job postings isnt a sufficient means to determine the number of jobs out there.
My brief experience back in the market suggested there's definitely not a real relationship between the jobs posted and the actual hiring process.