Capturing Keeps and bases is essential to any scenario since this secures your position in the battlefield. This allows you to extend your operations far from your allied base. There are specific bases you need to capture in order to complete a mission or progress in a scenario. Furthermore, there are specific Keeps that will reveal treasure chests once you capture them.
To capture a Keep, keep defeating the enemies until the Keep's gauge is depleted. Once done, the Keep Boss will appear. Defeat the Keep Boss to successfully capture the Keep. You'll lose your allied base the same way; if the enemy forces overwhelm the Keep and manage to whittle down your defenders, the Keep's captain will appear. Once he is defeated, the Keep will fall to enemy hands.