When you attack castles on the world map, depending on the soldier type and strength your army usually comes back with loot. (sometimes food, wood or stone but occasionally rubies on RBC-type targets). To attack you need to recruit Soldiers in your castle's barracks. You should send your army out with siege tools to increase the chances of victory. Plundering loot is a great way to provide your castle with resources if you are lacking a particular one. Sometimes you need to attack a castle to complete a quest. The higher your level and the more soldiers you have, the more loot and glory points you can obtain if the castle can gain you glory.