Tens of thousands of castles were built in Medieval Europe, and many still blanket the landscape. Why were the built, what were they used for, and why did the construction die out?