The contrast here is that the US (in particular -- the EU seems to be more thoughtful) doesn't seem to be maintaining its robust research program, while China seems to understand that leadership in basic research has compounding benefits on decadal timescales.
But while students vaguely knew that most of us would not end up on this path, we got little or no guidance on what else we could do. A common aspiration was to teach at a lower tier school, but the academic job market was saturated from top to bottom. I was ready to go into some kind of engineering. A lot of us became programmers.
I got lucky -- a friend of a friend owned a company, and hired me.
One thing I do remember is that as undergrads, we were advised to maintain a pretense of wanting to pursue an academic career, even if we had other plans. If you told them that you intended to finish with a masters and go into industry, you would probably not get accepted, would not get funding, and would be treated as a second class citizen. So students were pretty much told to inflate their expectations. That was a long time ago, and I don't know how it is now.
I didn't become a good enough research scientist to compete for a trophy gig in academia. What I saw is that my own university was hiring up, i.e., only considering applicants from higher ranked schools. That meant my chances were somewhere close to zero. I got to know the post-docs and understood their grind. But also, I became more interested in gadgets and making things work, than in directing fundamental research.