Castles evolved over time during the Middle Ages as attackers developed new siege techniques. Early castles like motte and bailey constructions in the 9th century used wood and earth but were vulnerable to fire or decay. Later castles from the 12th-13th century used improved building methods and stone construction to better defend against attackers, replacing vulnerable wooden walls and structures. Key parts of these stronger castles included curtain walls, towers, keeps for housing the lord and family, and defenses like moats and machicolations for dropping objects on invaders.