As you know, it is quite obvious that bicycle spokes attach the hub in the center to the rim. What else do they do? If you compare the wheels today with the ones from ancient times, there are more spokes now on motor bikes and bicycles than of a wheel of a chariot. Why is that? What effect does it have on the vehicle if there is a higher number of spokes on the wheels?
In comparing wheels of today to those in history, there are traditionally more spokes now. However, that's because wheels in the past (even large wagon wheels in not-so-ancient times) used relatively thick wooden spokes that behaved like a column and dealt with the load of the wheel with compression.
However, modern spokes are very thin. Far too thin to actually support any compressive load without buckling. Modern metal spokes are very easy to bend. However, when wheels are built, the spokes are threaded into nipples and the nipples are tightened so that the spokes are in tension at all times. A rod under tension does not buckle, so the instability is gone from the spoke.
How much tension is very important of course but this isn't an answer about wheel building (although if you want information on that, hit me up in chat or ask over on Bicycles.SE, I've built many, many bicycle wheels).
The real benefit to using thin spokes is two-fold. First, they are considerably lighter weight than the giant column-type spokes used before. Second, they are also considerably more comfortable because they do flex some under loading, how much can be tuned by the number, material, lacing pattern, and tension of the spokes. So there's a much greater control over the characteristics of the wheel with modern spokes than the giant column-type spokes of yesteryear.
In addition to carrying the load, bicycle and motorcycle wheels have to handle the transfer of power. On a wagon or chariot, the wheels just respond and have to roll. On a bicycle or motorcycle, the power from the rider or engine is transmitted to the hub, forcing the hub to rotate. The spokes then need to transfer that power to the rim to make the wheel spin. This shearing rotation is why rear wheels rarely have a radial spoke pattern and instead have spokes that are at various angles to the hub.
If there is weight on the axle the rim gets pushed down into the ground and tries to deform by flattening on the bottom and bulging right besides the ground. Properly tensioned spokes will counteract this bulging and lessen the deformation allowing for an easier and smoother ride.
This means that the rim does not have to be super resistant to deformation which allows it to be much lighter compared to a column-type rim.
All of the answers given are very good, and delivered well. Therefore, I have little to add to the question, but would like to mention that metallurgy has a great effect on the number of spokes needed for a given application in our modern era. The greater the tensile strength of the spoke material used; the fewer spokes that are required to transmit a given load value. Ferrari used spoked wheels on many of their early race vehicles, for the purpose of weight reduction. To insure maximum strength, while minimizing wheel weight, their engineers chose to use very thin spokes made from titanium alloy. Today, if you happen to sock a curb while making a high-speed grocery run with your vintage Ferrari, be prepared to pay in excess of $10,000 for a replacement wheel, if you can find one. Otherwise, the cost will be higher, to have one custom fabricated. Ah, the challenges presented to the unimaginably wealthy.
Note that the actual mechanics of the spoke structure is somewhat non-intuitive. I hope to clarify it here.
Spokes do NOT support the weight by "bearing" the weight as it goes down from hub to bottom of the wheel. They support the weight by keeping the hub "pulled up" towards the top of the wheel. That's why they can be flexible, because they are essentially working as ropes.
For clarity.. the old style wheels with wooden peg like columns were the kind that were bearing the load (i.e. getting compressed). The bicycle and similar configurations the spokes are getting "stretched" when doing their job.