We tend to think of medieval warfare as involving swords, battle-axes, archery, and catapults. But late medieval warfare also involved cannons.
Gunpowder came originally from the Chinese, who had used it to make fireworks. It took the Europeans to figure out that it could be used to kill people. Gunpowder came into use in wars in the middle of the fourteenth century, at almost exactly the same time as the Black Death showed up for the first time in eight centuries. The main war of the time is now called the Hundred Years War. All in all, it was not a good time.
Gunpowder was far too likely, given the metallurgy of the day, to blow up in one's hands for medieval people to develop pistols, but they did have cannons, built massively thick (to keep them from blowing up). Basically you stuffed gunpowder down the barrel, put a cannon ball on top, and lit the powder with a fuse. When it exploded, it shot the ball out the front. A cannon could not be fired very rapidly, but a row of them would have a devastating effect on the opposing soldiers.
Every army quickly acquired cannons (including Joan of Arc's army, though the movies don't show it that way). Cannons acquired personalities and names, like Big Bertha or Mad Margaret. The Hussites beat the imperial armies in Bohemia in the fifteenth century by mounting their cannons on wagons so they could drag them through the woods, practicing guerrilla warfare.
Not surprisingly, cannons radically changed the face of warfare. Knights quickly lost the predominance they had had since the eleventh century, since a cavalry charge could be stopped very effectively with a round of cannon fire. More and more generals relied on foot soldiers, recruited almost at random, given little training and little if any pay, intended just to be cannon fodder. With luck, after the first wave of foot soldiers were killed, pikemen could rush in and overpower the cannoneers before they could load again.
As this suggests, pikes and halberds continued to be important weapons even in an age of gunpowder. Bows were also very important, because one could shoot far faster with a bow than a cannon. But gunpowder just made the always hellish nature of warfare even worse. Because a castle could not stand up to a bombardment with cannons, many lords, who had been defining themselves militarily since the eleventh century, gave up on defensible castles and built elegant palaces/châteaux instead.