Stock market growth is also something that isn't necessarily benefitting the country where a stock is listed. A european investor can buy Apple stock and participate the same was an an American one.
Same if industries just gets more competitive, the economy can go way up with no change or with a loss in profit.
"Tech" is a force multiplier, whether that tech is factories, steam engines, gunpowder, chariots, printing presses, or software. The people who have the best mastery of the currently-most-useful force-multiplier tech at a given time tend to do very well.
Software, broadly, just currently happens to be the most useful force multiplier. That may change to the subset of software that is ML, or it may change to robotics, or something else entirely like synthetic bio.