I like this article I read about training for an ultra. Not surprisingly training is physical. As well as that there is the training to handle pain which is inevitable at some point at an ultra endurance race like 100miles. The third aspect covered in most detail is mental management. Not surprisingly over such long races your body can try to convince you to do anything but continue. It’s a natural mind response. Managing this and handling this challenge of the race is an area where many struggle and as the article says, this is often a major reason for DNFs in such races.
It’s worth a read 💪