I sent Bitcoin using the Cash app in my wallet. My wallet received the Bitcoin, then sent it to another address. Why did this happen?

I've transferred Bitcoin with the help of the Cash app in my wallet. Once received in my wallet, another transaction was made, which sent my Bitcoin to another address. I did not make this transaction. Am I being hacked? I would like to recover my bitcoin if possible. If not, I would like to know how to prevent this from happening again.