It might go so far that perhaps the reason the area never saw major military campaigns is because of the defensibility of it's castles?
Stone Age people painted the animals they were going to hunt on rocks so that the pictures would entrap the animals' spirit and they would be easier to catch. This method of ensuring a good hunt was not effective so why did they do so many paintings?
Military technology has to prove itself in this life, not the next. That's a more stringent test.
Without the wall, raiding bands of any size could just slip through and cause havoc. Only large and well-organized forces had siege equipment to break through wherever they wanted. Similarly, traffic and migration of peoples could be controlled and tolls and customs could be enforced. It also acted as an infrastructure for fast transmission of messages. In those ways, like the Roman Limes and the European castle networks, it was mostly an infrastructure for peaceful times.
But even in war, it was preferred to bypass it or to capture a gateway fortress, otherwise these forces could cause enormous problems for the attackers. For example, only allying with the Ming garrison at Liaoning made it possible for the Manchus to crush the short-lived Shun dynasty and establish the Qing dynasty.
Getting across animals and heavy equipment is not easy.
Cause enough delay to send some more soldiers to deter them some more?
Pyramids were built for the after-life. Not as a way to extend their life on Earth. Nobody could verify if it actually worked, so it's mostly a question of faith.
> Stone Age people painted the animals they were going to hunt on rocks so that the pictures would entrap the animals' spirit
That's just speculation from historians. It may be that they are right, but there are also other theories. One other theory could be that it is a way of giving thanks to the animals, and a way to honor their loss. Personally I don't think there is a single reason why they painted animals. People have always had different motivations
You made the following statements:
1. Pyramids were built so kings could live forever
2. The Egyptians saw that this did not work, but continued to build pyramids.
The first statement is not true. The pyramids were built for the after-life. This invalidates the premise for your second statement, as the Egyptians could not verify that it worked in the after-life (or that there even is an after-life).
Now that you see my reply in a different context, your castle analogy is also not relevant.
This is pure speculation. The track record of speculations by archaeologists isn't very good.
Probably the silliest speculation ever was when two gourds connected by a string were hypothesized to be an ancient telephone.