The quantity that is mentioned there is the safe limit which can be saved in case of an attack. & that is automatic procedure you can say kind of a metaphor since it is not actually happening.
Consider it this way the first 18k based off a level 20 harbor is to a degree being stored there. The remainder is inside your warehouses with a max limit at level 20 of 220k. If you're overflowing there's nothing you can do but spend it. But you shouldn't allow yourself to get to that point. Whenever you log off you should spend ALL your resources and when raiding pay attention to how much resources you have so that you don't waste any because you hit your limit and didn't notice.