Rifling
The "hand cannon" was first used in China in 1288. From this early beginning and a number of different guns, the smoothbore  Musket was in use in Europe by the 15th century. While it could not fire and reload as fast as an archer and could not be reloaded on horseback, it could penetrate armor. Its greatest advantage over the bow was that anyone could learn to fire a musket in a very short period of time. It took much longer to properly train an archer. The British army used the musket along with pikemen until about 1705 when the pikes were abandoned. In 1722 the army adopted a standard musket called the Brown Bess and continued to use it until about the 1830s. Muskets used a round cast ball that was smaller in diameter than the gun barrel. As a consequence, when the musket was fired, the ball bounced along the inside the barrel. When it exited the barrel it could take a variety of paths making the musket inaccurate. So soldiers were massed together very closely and fired in volly (all at the same time). This sent bullets flying generally in the direction of the enemy on the theory that at least some of the bullets would hit some of the soldiers. The smoke from repeated vollies prevented soldiers from seeing what they were shooting at. In the heat of battle, soldiers who wanted reload and fire faster sometimes omitted ramming the bullet and powder into the barrel with the ramrod. Instead, they would try to seat the ball by sharply hitting the butt of the musket on the ground. This reduced the effectiveness even more. Sometimes the bullet would do little more than dribble out of the barrel and travel only a short distance.