In addition, cavalry regularly punched through plate armour with spears (that's all a lance is...). Plate armour is great stuff, if it is properly fitted and padded you can run around in it all day (aside from massive heat exhaustion issues), it provides superb protection against a wide range of weapons and is even fairly comfy. BUT IT IS NOT PROOF AGINST THRUSTS FROM SPEARS.
I think people are talking about different things here. Armour plate was made to be virtually impregnable to most attacks. However, because of the way armour is constructed any armour has weak points (joints, and other places) a spear might very well be able to kill someone by penetrating one of those weak points and still be unable to actually penetrate the armour "head on", so to speak.
Even specially-made armour-piercing weapons had trouble penetrating the strongest parts of plate armour, including many early firearms.
First and foremost the spear is a formation weapon. If you fight agaisnt a single Sword and board foe you throw away your shield and use it with both hands or he will strike it out of your hand with a hard hit. You will still likely lose tho.
The notion that a spear is just a formation weapon is kinda odd. It really shines there, but it's much more flexible and useful than that, and there are plenty of systems for using spears in single-combat. (with or without a shield of it's own)
And remember, while a spear has a pretty hard time dealing with a lot of armour, so does a sword.
A makeshift army with makeshift spears and swords wont defeat a fully armored professional army in almost any case.
That depends what you mean by "makeshift" and "professional".
Leadership and organization existed in many forms. Wartime organization could piggyback on normally peaceful guilds, dike-reeves used to take commands when floods threatened could also muster men for wartime defense. It would obviously be of great benefit if a professional warrior was present to give some last-minute training and to take command in battle but it was also of great benefit if the men he worked with were already mustered and knew each other.
This. Europe was militarized to a fairly high degree, most people were probably members of at least some kind of defense organization or structure. Sure, they wouldn't be drilled or trained to the standards of proffessional troops, but neither would they be completely ad-hoc, they could be naturally raised for local defence (or rebellion, if needed)
Consider Visby, which is a pretty clear case of a local militia being completely crushed by a professional army... And even then armour seems to have been commonplace (mostly coat of plates with some mail)
"Peasant armies" just weren't the kind of completely unorganized rabble people think it is, when revolts happened they usually raised whatever local defence organization they already had in place.