But also? Nobility would not be part of the spearwall. Or, to be more precise, they would not be part of the first spearwall and may only be part of a formation that comes in to mop up when the battle is all but won. Or they would be mounted tanks in the form of plate armor (more richard than alexander). They key being that they would be able to get their blade wet but would be in little to no danger.
While they wouldn’t be part of the spearwall, they generally were in constant and very real danger. Cavalry is safer, but very far from safe, and often dedicated early in the battle to prevent enemy cavalry from taking the initiative. Richard I, for example, who lived before plate armor was in vogue, was constantly in the thick of the fighting, even when the battles were desperate. The Roman generals (and later Emperors) Vespasian and Titus both were wounded multiple times during the First Jewish-Roman War, and they even came from a less foolhardy military tradition of officership. Pyyrhus of Epirus died because he was in the thick of the fighting, and he wasn’t exactly a meathead. Genghis Khan, Emperor Alexios Komnenos, Harold Godwinson, it goes on and on.
These nobles were often a warrior caste, or near to being one, and whatever else may be said of them (how many ‘commoner’ lives they would sacrifice for their own convenience and glory, for example), “Unwilling to face danger” usually isn’t one of them. They’re brought up, not unlike what modern fascists have tried to do, in a society that glorifies death and danger.
Ultimately this is all nitpicking and me being quarrelsome about a small detail, lol, but I enjoy such details.