The word 'palace' comes from the Palatine Hill in Rome, upon which the Roman emperors built their palatial homes. Its use has since been extended to cover grand houses whoever they may belong to.
The form of the Palace of the Emperors on Rome's Palatine Hill derived from the palaces of Mesopotamian, Egyptian, Minoan and Macedonian kings. Though vast, it was a relatively dense building with internal courtyards. Such spaces could be used as external rooms. Their climate was better than open gardens and they were much more secure.
As the Roman empire became stronger and safer, the emperors began to build palaces in outside Rome. The most famous is Hadrian's Villa at Tivoli and it differs from the palace complex on the Palatine. In addition to internal courtyards, it had parkland and gymnasia distributed over a large area. We might call it an estate garden and it stands as a precedent for later palace gardens throughout Europe.
The palace on the Palatine Hill in Rome
Hadrian's Villa at Tivoli, outside Rome