We store private keys on our wallet. Private keys are what we use to spend our bitcoin. So even if you are offline, you can still receive coins because Bitcoin transactions are stored in a global ledger and everything is recorded. So the reason offline wallets are safer is because you can only spend Bitcoin by using the private keys stored in the wallet to which only you have an access to. Hope this helps!