A little while into playing Boom Beach you'll start to encounter Resource Bases.
These are island that, once conquered, become available to you to use and draw a specific resource from. For the purposes of this guide, I'll refer to it producing Wood, but there are of course more types of resources available.
After you've defeated the enemy inhabitants of the island, you'll begin to receive Wood via shipment to your Home Base. This is obviously a useful asset to have, and you'll want to protect it from attack.
Unfortunately you can't upgrade buildings on the Resource Base, and you can't build new ones there either. You're very much at the whim of whoever else want to come and take it, basically.
The one thing you can do is to make things harder for them to do so.
You can move buildings freely, and you can reposition trees too. This allows you to attempt to funnel bad guys into one area, and otherwise better position the layout of the island for defensive purposes.
On top of this, if you have some trees leftover, you can always just dig them up (at a modest cost) for a quick injection of Wood.