There is some correlation between selling good products and valuation. Intel's valuation for example went down 25% in 2020 in contrast to the NASDAQ US Composite index (of which Intel is a part) which went up over 40%.
Who decides it is a good product? Seems to me it is rather "selling a lot". Lots of people do not think Apple make good products and prefer Dell or Huawei etc. That doesn't change the valuation of Apple.