What Google says, and what sites report
Google's position is that it handles both, and that the choice should be driven by what is easiest to maintain. That is accurate as far as it goes: a subdomain is not penalised and can rank perfectly well.
The nuance is in how signals consolidate. A subdirectory is unambiguously part of the parent site, so authority earned anywhere on the domain applies to it. A subdomain may be treated as a separate site — Google decides case by case, and you do not get told which way it went.
What tips the practical balance is the volume of migration reports going one direction. Sites move blogs and documentation from subdomains into subdirectories and report gains; the reverse migration is rare. That asymmetry is the strongest available evidence, even without a mechanism stated outright.