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.
The spot price for 16GB of LPDDR4 looks like it's currently ~$8 per DRAMexchange: https://www.dramexchange.com/
They're also charging $200 for a 256GB storage upgrade - spot price of 3D TLC is $3/256Gb ($24 for 256GB) - you can currently buy a 256GB NVMe SSD (full stick with controller) at retail for <$30 as well.