The Federal government found a niche in basic research for a few decades and funded the vast majority of that. Per NSF, today even basic research is <40% funded by the Federal government, again not due to a decline in Federal funding but due to vast increases in industry investment. This shift toward industry investment in basic research was not overnight, it has been a monotonic trend for decades. Over the last century, the areas where Federal research funding is critical have dwindled greatly in scope because industry spends more money and is willing to take more risks.
One of the more interesting stories here is why and how this change happened in the US, to the point where the vast majority of R&D is funded by industry even in areas historically dominated by Federal government funding.