The medina of Marrakech is a dense maze of alleys, many too narrow for cars, which makes walking not just possible but often the only way through. There is no real grid logic, so getting turned around is part of the experience rather than a failure of planning, and most lanes eventually lead back to a recognisable landmark like the Koutoubia Mosque or Jemaa el-Fnaa.
Ground surfaces vary a lot, from smooth tiled squares to rough, sometimes uneven paths, and the medina can be crowded with pedestrians, handcarts, mopeds and the occasional donkey, so a steady, unhurried pace works better than trying to move quickly.
Outside the medina walls, the newer Gueliz district is far more spread out and grid-like, built for cars as much as people, so a taxi or ride there makes more sense than walking the full distance from the old town.