The annual NIH budget is >$50B and they earmark large portions of that for specific problems. This has paid off well for the US which became the world's leader in biotechnology and has maintained it for some time. NSF is another $11B, DOE another $50B (part of which is military, I admit).
Those only have a limited dependence on dozens of senators; the NIH typically gets most of what it asks for every year. The US has funded science at spectacular levels in a bipartisan way for some time (that may change in the future). Of course there is still a lot of political bargaining, I'm not going to deny that.
What's interesting is that we could clearly spend even more if we felt it was a priority. There's so much that could be taken from military spending without having a direct impact on our defense. But I don't think we want to do that; during my grad school career, the NIH budget almost doubled, which led to a huge bolus of grad students minted as PhDs, who then had no jobs beccause the size of faculty positions didn't change nearly as quickly.
I admire China's efforts and I see a lot of similarities in China to the US around 1900: the time when the balance of industry and technology shifted from EU to US, but growing your industry super-fast runs the risk of overheating and meltdown.