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.

If they're VC backed startups, they'll post a bunch of jobs to fake metrics about grow. If they're consulting companies, they'll post a bunch of jobs hoping to find competitor's employees to undercut. A company may have space to hire 1 person, but may not care if its a engineer, QA tester, technician, etc, so they post 3 jobs and only hire one person; but will leave the other job posts up.

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.

https://en.wikipedia.org/wiki/Ghost_job