Your attack can be blocked if a player has a shield. This will give you fewer coins than a successful attack. There are no real strategies in attacking. The only thing I can advise is to attack players that have many burning objects in their village. That means that they likely have no shield to counter the attack.
Raiding is a feature that gives you the option to steal other players' coins. This is often a friend, but could also be a random player or bot. I have encountered many bots with around 50 million each.
In raiding, there are 4 holes with 3 shovels to dig 3 holes. One of them is empty or has a bonus chest. The other 3 are filled with coins and one of them has more value than the other 2.
Foxy pet can be used to steal more coins. It must be fed with a treat to be active. Foxy will dig the 4th hole resulting in additional coins.
People can only raid a small number of your coins at a time. This varies depending on their star and village level. This is so you won't get bankrupt by one raid if you have a hundred of millions or billions of coins.
Most people play by made up rules about not raiding friends before asked of permission. You don't have to do that, but you will most likely get unfriended for "big-raiding" most people.
There is one strategy for raiding that I know called Two finger trick.
Two finger trick: if you have dug 2 holes and both had coins int them, then tap the 2 remaining holes exactly the same time and hold for a second. The one with coins will be dug and give you perfect raid.
Place fingers in level with each other and tap really fast, if you are too slow the delay respond will not catch up with a finger.