Your shares are stored securely in electronic form with the depository. No one can move them without your approval because every transaction needs your OTP/TPIN. You also get alerts on your mobile/email for extra safety.
If you have given a POA (Power of Attorney) or DDPI (Demat Debit and Pledge Instruction) to your broker, shares can be debited only for your sell transactions or to meet margin requirements. All such movements are directly reported to you by the depository, so you stay fully informed.