There is a whole piece on this in the book “The Art of Low Carbohydrate Performance” by Jeff Volek and Stephen Phinney. In it, the authors ascribe “hitting the wall” or “boinking” to running out of energy (literally). People simply don’t have enough glycogen to be able to fuel a marathon. This is one of the reasons they advocate a ketogenic diet. Even the skinniest person has enough body fat to last through a marathon. Their solution is to switch from carbs to fat for your body’s main fuel source.