This is not to imply that the nobility always _did_ oppose the enemies who they should have been opposing; but it's not at all the case that had there been no feudal militaries, medieval Europe would have been a peaceful place.
(I acknowledge that this is a very late post, and I apologize for that; but it's a common mistake to imagine that medieval European history occurred in a vacuum. The primary culprit here is the, ah, _insular_ way that English-speaking schools teach medieval history...)
And I was specifically talking about the Western European nobility between, say, 1000 - 1300 AD, a period when there were no outsiders invading Western Europe and it was the nobility itself that posed the greatest threat to the lives of "commoners".
I do, by the way, take issue with your description of the Muslims as a threat - that was true only between around 650 - 750 or so, until Charles Martel stopped their expansion at the battle of Poitiers, and it was true again for Romanians and Hungarians in the sixteenth century when the Turkish empire started to expand westward, but between those times (a period commonly known as "The Middle Ages" ;-) ) it was Western Europeans that were threatening muslims by travelling to Palestine in a misguided attempt to "liberate" the "Holy Land" from the "Infidel".