So, this might be a confusing question, but let me clarify.
I've read a lot about the fact that charging the enemy, particularly in the napoleonic era and later, was much more about making them break and rout before you actually got there, capitalising on just how terrifying a bunch of big men running at you with pointy objects is. From memory, the French Old Guard was considered terrifying not just because of their skill, but because they never broke in battle. except that one time at Waterloo
I'm sure that this is also the truth about previous eras in battle, but I hear much less about units breaking before receiving a charge from the medieval period and earlier. I'm sure this isn't because they're necessarily less scary than bayonet/sabre charges, but I was wondering if the infamy about bayonets and such made them scarier to their opponents than swords and spears did previously.
Did it have to do with the feudal warrior class before? (Knights/Samurai and such being trained extensively with the best gear and a warrior doctrine against far less trained peasants) or was it because people were more educated about how lethal close combat fighting was? Could it be another reason?
TL;DR were bayonet charges considered scarier during their time period than infantry charges were previously (during the renaissance/medieval era/earlier)?
In short yes, there were changes making close combat far less appealing to most soldiers during this period. Part of this has to do with the declining popularity of armor and shields, which made it more difficult for a soldier to stab someone with a bayonet without being bayoneted in return. It's also partly due to the fact that most soldiers were now armed with ranged weapons. With a gun, most soldiers' initial instincts are to fight at a distance, hence whenever speed and surprise were absolutely essential to an assault officers would occasionally order them to unload their weapons before charging so that they would not be tempted to stop and shoot.
However, the biggest cause is that guns themselves were beginning to make close combat far more dangerous. A spherical bullet has fairly poor aerodynamics, so while a musket could still injure or kill at a great distance they tended to be far more accurate and retained an absolutely devastating amount of energy short ranges. During a series of modern experiments in Graz, Austria an antique flintlock musket firing a 31-gram bullet was able to leave a wound cavity of 530 cm^3 in their simulated target at 9 meters. A modern 5.65 mm assault rifle by contrast left a cavity of only 101 cm^3. At the battle of Pavia in 1525, the heavy muskets used by the Spanish were reportedly able to kill two french knights in a single shot.
Soldiers came to develop a deep respect for the effect of firearms at close range. In the late 16th century french Lord La Noue described the "paradox" which allowed wheelock pistol-armed Reiters to defeat armored lancers in close combat:
. . . the Reistres are neuer so daungerous as when they bee mingled with the enemie, for then be they all fire. . . the two squadrons mee∣ting, they haue scarce discharged the second pistoll but either the one or the other turneth away. For they contest no lenger, as the Romaines did against other nations, who oftentimes kept the field two houres fighting face to face, before either partie turned backe.
(La Noue himself came to be known as "iron arm" due to the prosthetic he received after a gunshot shattered the bones in his left arm)
English mercenary Humphrey Barwick noted a similar trend for infantry combat in 1592:
[In past battles] enemies did then commonlye ioyne both with long and shorte weapons, as by the dints of two handed Swoordes, Battell Axes and Billes, with Leade malles, whereby the fight continued vnto the last end of the one party, but in these daies where the weapons of fire hath beene rightlye vsed, it hath beene scarselye seene that either Pike or Halberd hath come to ioyne at any time before the one partie did turne their fa∣ces, by reason of the terrible force of the great and small shot. . .
This didn't mean that melee charges had become completely obsolete. If a line of charging pikes or bayonets did manage to continue pressing forward without breaking their stride after withstanding an enemy volley it tended to be greatly disheartening for the enemy and would often cause them to flee. In later periods it was at times the fact that a disciplined, advancing enemy hadn't fired yet and the fear of what that retaliatory volley would do which caused the enemy to panic. Furthermore, whenever soldiers did press home with bayonets it was necessary that the attack be quickly decisive. Prior to the modern period, long melees could involve "pulses" where both sides suddenly backed off a few paces to catch a breather before building up the courage to continue. Some soldiers might continue the fight with arrows and thrown stones, but men with shields and armor could largely shrug this off. No one could shrug of point blank musket shot though, and thus safety could only be achieved by withdrawing a great distance if defeated.
To conclude, soldiers no longer had shields and armor to protect them in a lengthy melee, they preferred to hurt their enemies at a distance now that they had the means to do so, and the force of firearms at short ranges now made getting close an extremely deadly proposition.
Elizabethan Military Science
European Warfare 1350-1750
The Cambridge illustrated history of warfare: the triumph of the West
Weapons and Warfare in Renaissance Europe: Gunpowder, Technology, and Tactics
The Military Experience in the Age of Reason
The politicke and militarie discourses of the Lord de La Nouue
A breefe discourse, concerning the force and effect of all manuall weapons of fire