The castle was a genuine innovation. The Romans didn’t build castles, for example - private fortification was illegal in most of the empire - and the successor states of the west continued this tradition
Castles emerge in the late Carolingian. They are an expression - or arrogation - by private actors of the use of force within society. They represent a decline, in a sense, of state capacity. Royal governments resisted their spread, unsuccessfully.
The rise of the castle was contingent, not inevitable. But you could not have predicted it from what existed before. It was something new
Be careful when making predictions. History is not so limited as your imagination. This is maybe the real gift of the study of the past. You gain an appreciation for the degree to which things can change
It happened before. It can happen again
You could spend a lifetime exploring all the castles in Europe and still only scratch the surface