I have this fascination with castles. Always have had it, really. Recently they've been cropping up in my writing. What I find interesting about them is that most of the real ones still in existence look nothing like the Disney version or the fairy tale princess ones in story books. They're stone fortresses, built to make it almost impossible for invaders to reach and penetrate.
There's a distinction between castle and palace, and that may be where some of the confusion lies. A castle is a fortified residence for a lord or noble, whereas a palace is not fortified. Of course, given that kings usually resided in palaces, they most certainly would have been guarded.
The construction of a castle changed over the centuries as well. The early earth and timber castles gave way to stone. Windows were nothing more than slits, and one has to wonder about the air quality inside those walls. Most of them contained turrets we've come to associate with a castle, usually at the corners but sometimes in other places as well. The outside appearance changed as the threat of invaders lessened, so that castles built in later centuries took on more of the pleasing aesthetics we associate with the ones in fairy tales.
Common features include the castle being surrounded by a moat or perched high on a mountain, a keep, a gatehouse, and a curtain wall. The picture I've posted is the Neuschwanstein, a 19th century neo-romantic castle built by Ludwig II of Bavaria. It's rumored to be the inspiration for Disneyland's Sleeping Beauty Castle, and is open to the public for tours. I hope to visit it one day. :)