To be clear about this, you can still physically do the work same as before, it's just become uneconomic/not competitive. It's not all bad though. Having another country take the bulk of the market leaves you free to differentiate and specialize in one or more profitable niches that are not being served well by what is now the main supplier. You might end up dominating some fraction of what's now a vastly bigger market, with improved economies of scale that you're free to exploit as well.
We hope that it works out that way, but there's simply no guarantee. It's not an economic law.
If the country supplying said thing can have domestic companies deliver at lower margin, you're still kind of screwed. Their internal competition fills out the niches, which they can then export.
there's something that rubs me wrong about the argument of "we need IP laws because otherwise someone else might do the same thing as us, but better, and we won't be able to compete"
Your engineers lose their jobs, your businesses go bankrupt, you exit that entire field entirely for your entire population. Slowly your ability to do work begins to evaporate.
It's happened before and it'll continue to happen.