Starbases won't defend anything.
There are several kinds of starbases, cultural, military, mining.
In all of them you can install starbase defenses (in case they're attacked by a ship, they'll fire back).
If you build military starbases, then you can add assistance modules, that will greatly improve your ships attack and defenses. This way they are very usefull, since even defenders can then have all forms of attck and defense. And then, the more wins they have with that asssistance, the more hitpoints it will get due to experience, so the ships also gets tougher to destroy. But starbases won't do anything on their own, unless if theyy are attacked and correctly equiped for defense.
Hope this helps