Until the VERY recent Chevron ruling, that's how Congress's powers were intepreted.
The Necessary and Proper Clause (or Elastic Clause) in the Constitution grants (or granted, I guess) this power.
It's wild to think how Republicans used to complain about activist judges, but the current Federalist Society slate has undone at least 100+ years of precedent in the last half dozen.