With regards to the second, this post does an absolutely spectacular job describing the thought process behind charges and the like.
I think it's very clear that there's far more to the context of the situation than the simplistic point of view that you're looking at. Battles in the Civil War weren't all fought in meadows, for example. The battle of Gettysburg was fought with lines based on ridges, and consistently throughout wars high ground was sought because of the advantages it provided. Things like the battle of Bunker Hill in the American Revolutionary War were examples of this: hills could be used for artillery to bombard cities more effectively, and gain better defensive postures.
Some military operations fail, due to poor planning, overconfidence, mistakes in understanding of terrain, etc., but the vast majority of battles were fought using a very diverse understanding of tactics and planning both geographically and in terms of positioning. The Golan Heights were a very important position in most wars Israel fought with its neighbors because they were so suitable for artillery and attacking cities nearby more effectively, and walls were good for more than just keeping someone out: imagine how easy it is for them to drop boiling oil on people, or shoot arrows down, and how much harder it is to hit someone who is an unknown number of feet above you on a wall that affords their body partial protection.
I don't think you're giving a fair representation to the work of the tacticians who went into battles in the grand scheme of things.
the landing at gallopli was a mistake the ANZAC was planing on landing further up north at a less fortified position but someone messed up at some point and the biggest amphibious landing at the time landed at a much more fortified beach with a steeper inclination and was forced to try and fight its way across the beach