To understand this, in your own wallets (ex. core or electrum), you have the total control over the private keys of your addresses.
In exchanges, they are only giving you the address (they have the PrivKey) which they issue when you want to deposit your funds that will be "recorded" to their database as your balance.
After that, they can move the funds from that address whenever they want, however, it will not affect your displayed balance in your exchange account.
You can check this your own by checking your deposit address in any blockexplorer like blockchain.info.
You will notice that sometimes the balance is still there even if you already traded your Bitcoins.