So in the time of black powder, at first, it was muskets and pikes. The musketeers and the pikemen supported each other on the field.
Then the musketeers started to use a plug bayonet. Not as good as a pike, but the added firepower and larger, massed formations of men who could then transform their muskets into a pike, was a huge advantage. The disadvantage was one either could shoot or use the bayonet but not both in quick manner.
Then came the socket bayonet, and voila, the spear could shoot at any time and be loaded while the bayonet was used. Another huge advantage.
Meanwhile, hunters were using bows and crossbows. Then at about the end of the 1400's, apparently in the Free Imperial City of Augsburg [now part of Germany] what we call "rifling" was first introduced. A little more than 20 years later in The Imperial City of Nuremburg [also now part of Germany] the idea was improved upon, and at the same time the wheel lock was developed, also in Nuremburg.
It took a while for the idea to catch on over a large area. Rifled pieces were expensive, and took time to build. They at first were a rich fellow's hunting arm. This is why a century later, you have the fictional story of The Three Musketeers, not The Three Riflemen. As they were hunting weapons, it was found that the length of the barrel gave a shooter a better sight plane, and better shots were made. As much of Germany was not "old growth forest" but more akin to what most of us encounter in the United States today, and as a lot of hunters were mounted, shorter hunting rifles were developed, compared to longer target rifles. Germanic hunters wanted a large bore rifle that would hit hard and put the game down. Less tracking and less chance of losing the game in those thick, tangled forests (so the story goes), and perhaps the first application of ballistic impact to make up for what may have been less accurate barrels due to manufacturing skill at the time or what we'd call poor powder (just my conjecture; no reference for this). As time continued, the barrels improved but the style of the shorter barrel on the hunting rifle, what we call a Jaeger rifle, was established. The short rifles were brought over to North America by the Germanic gunsmiths, but other factors began a change. Apparently there was a great deal of "old growth forest" and accuracy was the key for the hunters in North America, BUT lead was also not in abundance and was expensive. Barrels started to lengthen and calibers reduced, as the accuracy would make up for less impact,. Even though men still moved about on horseback...., the hunters often if not always dismounted to hunt in the Eastern Woodlands. Rifles were still not using bayonets, even when riflemen were introduced into armies such as in Germany in the mid 1600's. George Washington's papers include a drawing of a collapsible pike for riflemen to carry to protect themselves from British (bayonet armed) light infantry.
Eventually rifling is introduced to military weapons for the common private, at about the middle of the 1800's, and since the musket had a bayonet, that remained BUT they called the weapon a rifled musket. It was a little while until the terminology simply referred to a private's weapon as a rifle..., and we call them that today, and they also still carry bayonets unto this very day.
LD