Most bitcoin wallets are open source. This means that anyone is able to inspect the code of the wallet to ensure that these types of attacks could not happen.
typical geek answer. so this is what you would reply with if your grandma asked the question, just before she went and downloaded a wallet from a website she never personally heard of but had been told by a friend to go there...