Although depicted mostly in mythology and as ornate super luxurious vehicles of the kings and generals, theses were a lot more than ostentatious vehicles for the rich, mighty & divine. This war technology ruled the battlefield for 1000 years before being replaced by less cumbersome cavalry.
An effective cavalry horse needs to have the strength and stamina to carry its mount in full armor at full gallop the entire length of the battlefield. The first horses were smaller, less powerful and had a natural instinct to run away from smell of blood, loud sounds or sight of sharp pointed spears. It took centuries of genetic enhancements through selective breeding to overcome these problems to create an effective cavalry. Therefore, the people complaining of additional cost of chariot as the reason for decline fail to appreciate that the chariot enabled effective use of cheaper and more widely available multi-purpose horses (some maybe from the baggage train) to the front lines. Since good horses was always in short supply, this small advantage meant that a large chariot army could be raised faster than a large cavalry army. The legendary horse Bucephalus was purchased for 13 talents (each talent is 26kg of gold) indicating the prohibitive cost of good beasts.
A horse can pull 8 times more weight than it can carry on its back when travelling on firm flat ground. Therefore, it allowed a mediocre pair of horse carry 3-8 warriors to the front lines and retreat once the enemy was close. In comparison, Ghenghis Khan’s Mongolian cavalry, which did not use wheels that effectively because of the terrain, had to maintain five horses per rider in order to maintain mobility carry enough supplies and not wear-out the main battle horse. Therefore, the investment or capital required for both kinds of armies was comparable.
Early riders used nothing more than a blanket as a saddle or cushion and reins to control the horse. As a result, horseback was not a very stable platform for mobile cavalry archery. The carriage of the chariot had a sound suspension, with its two wheels and the floor made of woven raw leather was much more stable to aim arrows amongst the shields & helmets of the enemy. The stirrups & saddle developed later, not only allowed to have a much smoother ride and better aiming platform but also control the horse without use of hands on the reins.
Since first horses had strong natural instincts of fight & fright, a dedicated charioteer controlling the reins and tying the horses to the wooden frame were the practical solutions. Even if the horse kicks and breaks the chariot, the riders were safer than what their fate would be post fall from a horse laden with pointed weapons. In addition, by having two person, one specialized in horses and second in weapons rather than one cavalry person mastering both trades. Hence reducing the training time and cost to field an effective army.
The earlier bows were all wood and not composite which made them longer. Cavalry achers using longer bow could shoot only left which limited their effectiveness in battle. Foot archers firing from behind the safety of friendly infantry lacked the range and piercing power against heavy infantry that carried shields, helmets and armor covering their vital organs. Chariots enabled archers to come close to the enemy, fire arrows, hurl javelins and flee back once enemy was near.
The war chariots with walls of leather or woven wicker not only provided extra protection but were so light that the chariots could actually could outrun a mounted horseman pursuing them.
I am not detailing the advantages of cavalry/chariots over infantry in terms of speed, shock, ability to pursue, flee etc. The comparison here is more of chariots against mounted units or similar units from a purely military, scale and economic point of view.