Aha, the pics make it much clearer. Usually the purpose of the higher inner walls is that should an enemy conquer the lower walls, you can shoot at them from the higher walls. Since the battlements are on the outside they have no cover.
So from a defence point of view the higher walls should be moved back a little from the lower walls. Then it is more difficult to conquer the higher walls as wel, as the attackers need to scale the entire higher wall.
Often the gates were set recessed in the wall, with towers on either side. That makes it much more difficult to attack the gates.