I see this question a lot.
Here’s the data that I have on it.
TL;DR: For SEO? Subfolder over subdomain. Always.
Here’s more context:
Hopefully this is helpful.
Here’s data from Drift:

and John Doherty’s reply:

When Monster.co.uk moved their blog from a subdomain to their root domain, Google saw it as one website and instantly increased rankings of every blog post:

Here’s another website with the same result:

Site: https://moz.com/learn/seo/domain

Site: https://www.searchenginejournal.com/subdomains-vs-subfolders-seo/239795/
Screenshot:

Site: https://ignitevisibility.com/why-blogs-on-subdomains-are-basically-worthless-for-seo/
Screenshot:

Screenshot (point #2 here is crucial):

