What happens when I take a players capital?

I’m in my first real game, I’m about to go to war with someone and their capital can be reached just by just taking a few planets. If I succeed and take his capital. What happens?

Same things as with any other star. It’s just a very good star with likely some good amount of infrastructure on it.