Deciding which exchange to buy BTC from (and sell at a future date) I wondered if I could choose one with the best fees for buying and a separate one with the best fees for selling and if this is even allowed.
Sure, but you'll have to use the blockchain to transfer the bitcoin from one exchange to the other.
It is as I read in other threads but there seemed to be a fee for this type of operation. I thought when you bought BTC from an exchange it would be exactly the same BTC (not a wrapper instrument) as if you bought it from any other exchange. How could there be extra fees if the exchanges themselves can't tell where the BTC in your wallet came from?
There's a fee for executing a transaction on the blockchain. Exchanges typically impose this as a "withdrawal" fee. They don't care where you're withdrawing from or where your deposits come from. But those transactions do have a fee associated with them.
I also struggle to understand why there would be fees to transfer BTC from one wallet to another. A wallet AFAIK just stores private keys, anyone in possession of those keys (like yourself) could just register in another wallet and use that private key to transfer the BTC to your second wallet. I'm sure there's a hole in my reasoning somewhere.
Right, so to transfer the bitcoin from one wallet to another wallet, the private key that authorizes their transfer has to be changed from one custodied by one wallet to one custodied by the other wallet. Only the blockchain can do that.
It is impossible for an exchange to assign separate private keys to every user to minimize fees. In fact, such a setup would maximize fees because every transfer of bitcoin balances between users on the same exchange would result in a blockchain transfer.
For example, say I deposit one bitcoin, then sell it to Alice who sells it to Bob who then sells it to Charlie. If the private key securing that bitcoin had to change each time, then each of these exchanges would require processing a transaction on the bitcoin blockchain. That would be much more expensive than executing blockchain transactions only on withdrawals.