Artillery fire and indirect fire weapons accomplish so much more than just destruction. It serves as area denial, it restricts movement, it destroys morale and is a constant source of casualties. Artillery is also cheap. An arty shell is so much cheaper than precision guided munitions. Furthermore, artillery since the introduction of the cannon has been the most deadly weapon in war. Accounting for around 90% of casualties. Though that number has probably gone down in the last couple of decades with the refocus to fighting goat herders. Artillery probably does account for the lion's share of casualties in Ukraine. So yes it does win wars, for centuries it was the most important piece of equipment for an army outside of the actual boots on the ground.
If a company is hiding in a forest, do you complete an exhaustive amount of ISR and recce to determine their position, which is probably not static, to attempt to hit it with a JDAM. Or do you go "fuck your forest" and flatten it with a couple hours of artillery denying the use of that area and causing casualties. On top of that, using an artillery screen is a much more effective way to cover an advance, keeping the enemy from maneuvering, so your people can get into position. You can't do that with ALCMs or other smart guided munitions, just because there just isn't enough of them.