Try gauging demand accurately for products and figuring out how much to manufacture. If things are popular, you run short. If they aren’t, you have surplus. Optimizing the inventory quantity is really hard. You have to introduce new products to keep up and customers just don’t want the old stuff.
When I worked in China in the mid 70s, I went to three different remote job sites all over the country. The entire country had ONE table lamp for sale everywhere. I swear the entire country had only ONE architect as well and he ordered all building materials in gray. Would you rather have that business model?
of course not. But what is wrong with donating the unbought stuff to charity?