1. You deposit BTC at an exchange. The exchange credits you the amount in their non-BTC ledger.
2. You send off a chain of blocks overwriting the the original deposit so that you never did it.
3. You fill in the form to withdraw your credited amount from the exchange.
Now you have 2x the coins.
Of course there are a LOT of details to this that I won't get into, and a number of mitigations for the exchange. But that's the basic outline.
However, the largest risk is from the software side. The physical owner of the hardware spends money, a hacker only spends their opportunity costs.
Note that, until the 2-week boundary where difficulty adjusts, they only get 100% of the roughly 45% less frequent rewards, since the 45% orphan rate will slow down overall progress.
When you make a valid transaction, you have the necessary details for both that valid transaction and no transaction at all. Just because you can't make invalid transactions doesn't mean you can't effectively steal.
This is why lightning network is a shitshow, because you have to be constantly alert for that behaviour.
Edit: you can also create multiple forks and switch between them. External viewers will see both forks and if they don’t or can’t handle the difference they could experience a double spend.
That being said any miner has the ability to sort transaction any way they want which can give them an advantage. So if someone has a lot of hashing power they can use that ability to delay certain transactions or to give preference to others.