Summary:

The palace is a special building. Part building, part Wonder, the palace automatically appears in the first city you build, which makes that city the capital of your empire. If your capital city is captured, your palace will automatically be rebuilt in another city, making that city your new capital. If you subsequently retake your original capital, the palace will move back to its original location.
The palace provides a small amount of production, science, gold, and culture to your civilization. If you connect other cities to the capital by road or harbor, you will create trade routes which generate additional income.