Even if we account for the argument that it is much more tedious to train a man to use a bow than a musket, why then did the arbalest not make a comeback? Its effective range - reportedly at 300m, is still much better than a smoothbore musket from the 18th century and is probably more accurate as well. An army composed of 14th century arbalesters seem to have much more tactical options than an army of fusiliers, so why did the crossbow not make a comeback?
Yes, a trained archer can probably put more effective shots on an unarmored target than a trained musketman of the 18th century. The problem is that word trained.
Consider that most nations in the 18th century did not have a standing army. Men were called up, served their time, and left. That means you either need to use skills they already have (in WWII this would be things like being able to drive and maintain a car) or you have to train them quickly only to have them disperse next year.
It takes a long time to train and equip an effective archer. Unfortunately I don't have a citation on how long, but to get an idea there was King Edward III's decree in 1363 "that every man in the same country, if he be able-bodied, shall, upon holidays, make use, in his games, of bows and arrows... and so learn and practise archery" so the King would have a population of trained archers to draw on whenever needed.
Archery is a skill which degrades if not practiced, both mentally and physically. Archery requires a lot of strength to draw the bow and hold it steady to aim, on the order of 100 pounds of pull. It is physically demanding to simply do it once, much less 60 times over the course of a battle.
Archery requires not only aiming at the target, but calculating the elevation and wind drift of the light, arcing arrow. A bullet, in contrast, flies relatively straight at the ranges battles were fought in the 18th century, 100 to 200 meters.
Good bows were expensive and time consuming to make, four years, not to mention the arrows, and each had their own unique characteristics requiring a bow to be matched with a bowman. Muskets were relatively cheap by the 18th century and could be made to such a standard to be considered a general issue item. There was no need for a musketman to practice with a particular musket.
In contrast, it is relatively easy to teach someone to load, (sort of) aim and fire a musket. The key to their effectiveness is standardization. There's no strength requirement, anybody can load and fire a musket effectively. With the advent of paper cartridges the amount of powder used, and thus the characteristics of the shot, became more standard. Because musket balls fly relatively flat compared to arrows, you can point in the general direction of the mass of charging troops and fire. The order was not "aim" it was "level".
Volley fire is the main innovation which made muskets so devastating. Three rows of musketmen, the front rank kneeing, firing all at once in the general direction of a charging mass of troops, could demoralize and break up a charge. If the enemy did not break, musketeers acted as a wall of pikemen with their bayonets.
The further innovation of volley fire by rank, one rank advances to the front and fires while the other two reload, meant a sustained volley of fire could be kept up even with slow to reload muskets. The movie Zulu has an excellent depiction of this tactic.
What about crossbows? They share many of the same advantages of early muskets over archers. They're easier to train than archers, cheap to produce, aren't unique per weapon, and don't demand as much strength. Compared to early firearms they were accurate, quick to reload, and had equal or better range.
You asked about 18th century muskets, for example the Brown Bess used by the British army. By that point muskets had advanced to be superior to crossbows. Even with special devices to aid reloading, "a skilled arbalestier could loose two bolts per minute" while a skilled musketeer could do four doubling their firepower. Muskets have the additional advantage of their long length and bayonet doubling as polearms allowing musketmen to defend themselves hand to hand, crossbows do not. Crossbows have the same problems of aiming as an arrow. A bolt flies at about 40m/s, while a musket ball will do 400m/s. The flatter trajectory of a musket makes them considerably easier to aim: point and shoot.
A heavy crossbow with characteristics of range and stopping power similar to an 18th century musket is as heavy and bulky as a musket. Crossbow bolts are much bulkier and fragile than powder and ball. Finally, a musketeer with a bayonet has an effective polearm making them useful in hand to hand combat, while a crossbowman would have to carry a second, large, heavy primary weapon to be effective as a group.
In terms of range, crossbows and longbows did have an advantage at 200 to 300 meters vs 100 to 200 meters for the Brown Bess. Once that gap is closed, muskets have all the advantages of weight of fire. The range advantage of bows is further reduced by the obscuring smoke from black powder (just because your army is using bows doesn't mean the enemy is).
The final nail in the coffin for bolts and arrows is stopping power. While a musket ball, bolt and arrow all weigh roughly the same (about 30 grams) a musket ball flies at ten times the speed. Kinetic energy is the square of the velocity giving a musket ball 100 times the energy of an arrow or bolt. An arrow strikes with roughly 50 ft-lbs of force while a musket ball hits at 1000 ft-lbs of force. This assures each hit with a musket ball will knock a soldier out of the fight increasing the effective firepower of the musket.
But what about the repeating crossbow aka Chu-ko-nu? Yes, it could fire 10 bolts per minute. However, the range and accuracy were extremely poor. The repeating crossbow is a necessarily lighter weapon than a regular crossbow firing lighter bolts. They had an effective range of only 80 meters (compared to over 200 for a musket). The bolts thrown were lighter which means less accuracy. For this reason it was used in massed formations, like muskets, but this could not make up for its appallingly short range and lack of stopping power.
Large scale combat is primarily about breaking your opponent's morale. Prior to the 20th century, the primary means for getting people to throw themselves in harms way in a controllable fashion was to organize them into large groups, drill them so it's second nature, and advance in tight formation for mutual defense, concentration of firepower and mutual support. The question is how fast you can effectively throw ammunition into the enemy's tight formations in order to kill or wound as many men as possible as quickly as possible to break their morale and run. Beyond specialist roles such as sniping, considerations such as long range fire and stealth do not apply, nor does the talent of the individual soldier.
One often missed factor is that arrows are delicate and require skilled fletchers to make them. The English invasion of France under Edward IV in 1475 required two years lead time producing enough arrows to supply his troops on campaign.
Also the logistics of transporting arrows is problematic. A sheaf of 24 arrows takes up considerably more space than a similar number of musket ball. During transportation arrows are easily damaged, especially the fletching, and require careful handling. They are also susceptible to damage from moisture.
When I was shooting regularly I could shoot 12 arrows a minute, English archers during the 15th century were probably closer to 20 a minute. That's a hell of a lot of arrows to make for a campaign that may include many skirmishes, battles and sieges.
Another factor is that most states don't like their citizens being armed with powerful weapons that maybe be turned against them in potential rebellions. In Europe most states controlled the manufacture of gunpowder in state owned powder mills, thus controlling who could use firearms. Bows represented a threat to the state as the manufacture of arrow could not be similarly controlled.
Also mentioned previously is the training requirements to shoot a powerful bow. It took me 2 years of training to be able to loose a bow with a 100lbs draw weight.
There have already been some good explanations, regarding relative ease of use for muskets, as well as less training required to use, but I have not seen two constants of campaigning considered: Rain and Disease. Gunpowder and bowstrings both need to be kept dry. On a bow this was possible by unstringing it, and tucking the string somewhere relatively dry. With a crossbow, it was nigh-unto impossible. At Crecy, crossbowmen were basically useless due to hard rains and wet bowstrings. Their volleys fell short of their targets. Yes, they are easier to aim than a bow, and faster to learn to use (much like muskets), but to build good ones requires pretty advanced metal-working, and at that point, your manufacturing base becomes capable of building some pretty good firearms, too. Crossbows, armor, and early firearms co-existed on the same battlefields for a couple of centuries, but that was when firearms were not yet a mature technology. By the 18th Century, that had changed.
Disease is pretty self-explanatory. Someone who could barely stand from dysentery, could still fire a musket. Good luck drawing and accurately firing a 100-lb.-draw longbow in that condition. If you could get somebody else to load it for you, or had enough time to do it one-handed, you could even fire a musket with a wounded, or even broken arm. Not so with a bow.
Wood is an irregular material, and difficult to work. The quality of the finished product will vary wildly, depending on the skill of the builder. In contrast, by the time of the Brown Bess, many parts were being made on primitive machine tools, assuring speedy, uniform manufacture, and thus also interchangeability of parts. The musket could be repaired from cannibalized parts. If a bow broke, it was firewood. If a crossbow broke, it was shrapnel. Broadly speaking, the bow is stone-age technology, the crossbow is medieval technology, and the 18th-Century musket is from the birth of the modern industrial era.
I think the argument of muskets also being effective in close as pole-arms is not entirely accurate. At best they could be considered a heavy, short, clunky spear, that could double as a club. Early bayonets were usually plug-type, so you weren't firing after that point, and plug bayonets were still in wide use in the 18th century. Calling that a pole-arm demeans pole-arms, which were purpose-built and devastating; the "anti-tank rockets" of the medieval battlefield.
On the subject of armor, you must remember that full armor co-existed on the same battlefields with firearms for well over 200 years. By the 18th Century, it temporarily lost the arms race to firearms. Armor has never been completely phased out. Helmets remained, and body armor was occasionally brought back into use at various times for specific uses. There were cuirrasiers into the time of Napoleon, and even a few musket-proof cuirrasses in the American Civil War, and steel body armor for machine-gunners in WW1. By then, armor had been motorized in the form of armored cars and tanks, and even the first armored airplanes. So what I assume you are really asking is why archery didn't make a comeback after the wearing of full metal body armor became nearly unheard-of during the 18th Century.
The same issues of economics and training apply to armor, as apply to weapons. Full armor was an added expense, it took quite a while to make if the quality was decent, and most importantly, it required (like bows) much more training and conditioning for the person wearing it. By the time muskets could reliably breach even the thickest plates on a suit of armor, you were looking at a possibility that a skinny, dehydrated teenager with food poisoning could use a musket to kill an extraordinary athlete that took years to train, in a full suit of armor. That math, applied on the grand scale, had been ushering armor out slowly since the days of the longbow, and real polearms, and massed pike formations, and early cannons firing langrige (any sharp, hard objects shoveled down the barrel). The armored warrior of the Middle Ages, on horseback, was the "tank" of his day. By the 18th Century, though, the Brown Bess "anti-tank rifle" had become so inexpensive, common, easy-to-use, easy-to-maintain, and easy-to-fix, that full armor didn't have a chance. And neither did bows, for the same reasons.
-And as for the muskets-vs-archery argument, I would say that during the many American "Indian wars", that comparison was tested repeatedly, with very poor outcomes for archery; for all the reasons listed by myself and others here.
There is a medieval Japanese saying that covers the economic side of warfare very nicely: "A hundred spears worth 10 rio (silver coins) apiece can defeat one sword worth 1000 rio."
One last thing to consider is that the 18th Century saw the rise of the first Democracies in nearly two millenia. With that came the concept of the citizen soldier. -And when he wasn't soldiering, that citizen had work to do, possibly a free life of his own to pursue, and probably little time or inclination for constant archery practice at the behest of his "betters".
There's a lot of very good answers already; but I'd like to add on to what @Schwern has said from a Japanese perspective.
When the musket was introduced in Japan in the 16th century, it quickly overtook archery in terms of importance. This is despite the fact that archery remained (and remains) a culturally important and valued skill among the samurai. Moreover, bows were (considerably) cheaper, so mass production or logistics wasn't the concern. At the then level of technology, the effective range and stopping power of firearms was also roughly comparable to that of Japanese bows of the time.
Yet the armies of the time began mass adoption of firearms with considerable enthusiasm. The main reason was the training required. The samurai, as professional soldiers, could invest time and effort in the Way of the Bow. With the rise of mass armies and near-continuous warfare during the Sengoku Era, there was a pressing need for fighting men that doesn't take a decade to train - besides the fact that samurai status was a privilege not for mere farmers. With firearms, teams of musket could be trained and deployed in combat with acceptable effect in a matter of months.
Therefore, the question's premise of ignoring that it is much more tedious to train a man to use a bow than a musket is inherently flawed. The higher skill barrier is a decisive factor, at least in some armies. It was a critical consideration that can't just be swept under the rug in a counterfactual.
Schwern had a lot of very good points, but there are other factors as well.
siege warfare. Most of the battles in 17th and 18th century were sieges, where at least one side was fortified. Bows and crossbows have to be aimed relatively high to shoot at longer ranges. This means both that it's easier to protect against them with a simple wooden roof, and that it's harder to shoot with them out of an embrasure. Longbows are especially ineffective to fire against cover: you cannot keep it ready to fire for more than a couple of seconds. If an enemy head pops up from behind a wall, by the time you can draw your bow, he already disappeared behind cover, or already shot you.
stopping power. Even fatal wounds are not instantly fatal. In a fight adrenaline can keep someone fighting for quite some time even with fatal wounds. If you have to hold a line while the enemy is charging against you, stopping power becomes important. Maybe you fill them with arrows but they can still hack you to bits with their swords before they bleed out, or crash through your lines in case of cavalry. Even in modern times there were plenty of cases when people kept up fighting for some time even after being fatally hit by multiple bullets. Muskets, however, had enormous stopping power. They had a huge caliber (a 0.50 bullet would today be classified as monstrously large, but most muskets were at least 0.70 or larger), and caused a hydrostatic shock while entering the body. Unlike arrows and modern bullets (except the banned expanding bullets), they didn't cut the flesh but punched it, and the body being made mostly of incompressible water, it caused a shockwave traveling through the body, ripping organs apart and giving such a shock to the nervous system that it could put the target out of combat immediately. Even if he was to survive the wound, the shock was big enough to put him out of combat, and that is more important than a shot which would kill him in 10 minutes but doesn't put him out of the fight until then. In combat, stopping power is more important than lethality.
Logically, if armor made archery obsolete, then why would you bring back archery knowing that it can just be countered again with armor? Moreover, that arrows could be stopped by armor while bullets couldn't pretty strongly argues archery was essentially uncompetitive with guns.
What others said about archers training makes sense too, I'm just saying the whole idea doesn't really make sense to start with.
One of the answers is the effect of Muskets and bayonets on Cavalry. An crossbowman needs someone else with a pole arm to protect him from cavalry. Formed infantry with muskets and bayonets can defend themselves from cavalry charges. Together with the Musket's higher rate of fire and greater stopping power at shortish ranges that tips the balance well in favour of muskets.
While there are various differences between the tactical properties of bows, crossbows, and 18th Century firearms, I would say that they were not clear enough that anyone contemplated training large units of archers as a military alternative.
However, I think that your thinking that there were certain advantages of archery at some point is theoretically correct - I would love to hear if anyone actually did form a special archer unit to take advantage of the differences.
I think the main reasons come down to:
Firearms are the newest weapon, and reverting to older weapons doesn't seem like an advantage. It would require convincing everyone involved to go along with one's opinion that one should form an archery squad in the 18th Century. Military authorities often don't like to hear you think they should change their ways, unless you out-rank them. You might be able to do it for a small elite group, but convincing a nation to shift its military to shift to archery?
Firearms have been getting better and better, and the actual decision-makers for military weapon choice are not just tacticians looking for niches with advantages.
Even if you did redevelop large-scale archery for a major weapon of your 18th Century army, it would take years to train people, and your opponents would find out what you'd done, and if they were concerned, they might choose to bring a bunch of large shields to battle, and/or wear more armor, which would be an easier counter-measure than training archers.
Firearms have advantages too. Size and manufacture rate of ammunition. Ease and speed of training. Built-in polearms with bayonets. Those combined to allow fast creation of large, flexible and efficient armies, whereas I don't imagine it would be so easy to produce the same size and quality of a force of archers, and such an army wouldn't have the same properties.
There was one man who carried a longbow into battle in World War II. Jack Churchill once shot an enemy German soldier with his longbow. He was also known to carry a Scottish broadsword into battle.
Have a read of the Wikipedia article.