You will find that you will probably get attacked every night. I always do.
I think they get 50% of what is in your collectors and 20% of what is in your storage.
Also that percentage drops if you are being attacked by someone with a bigger town hall than you.
For instance I currently have 1.9 million in gold stored up. Someone might completely destroy everything I have, but they are unlikely to get more than a couple hundred thousand. And because all my defenses are maxed out, anyone on the same level as me has no chance of getting all my gold. They aren't powerful enough.
Great tip for attacking for gold:
If you notice a city has no coins in storage, then all their gold is in the collectors. Usually those are on the outside of the city. You can at times get lots if gold just by attacking 4-5 collectors and only using a small portion of your army.
I sorta messed up my post earlier. Attackers definitely get more from the collectors than storage...I didn't make that clear earlier even though I said to clear your collectors as much as possible.
Regarding your last sentence....how do you know there is little coin or elix in storage? Just based on the coins inside the storage case or if the elix looks low? I saw some talk about this in my clan and they were saying there is something to the side of the storage, but I don't see anything. Maybe it's an ipad feature or I have no idea what they were talking about?