Many laptops now have soldered RAM, but other vendors have not chosen to do what Apple has done. In HP's premium laptop (Spectre x360 13t), adding 8GB of RAM is a +$70 option. For reference, an 8GB DDR4 SODIMM at retail pricing is about $30.
Also, AFAIK, no other major laptop or mini-desktop manufacturer uses soldered storage like Apple does, so in this case, the retail cost for storage is even more relevant.
These are commodity parts, so there's not any R&D to recoup - this is just profiteering on Apple's part. Especially for the Mac Mini, where there's not the same space constraints, the lack of storage upgradability is also a rather egregious form of forced obsolescence. Fine from a business perspective, but hypocritical for a company that claims to care about the environment.