What results in the price difference for seemingly the same product? I am considering buy the latest Apple Mac Mini M1 with 512GB storage from Apple or from Amazon. Apple lists it at $899 while Amazon lists it at $859. What is the hardware/software different that results in Amazon being $40 cheaper than from Apple directly?
There's no hardware or software difference.
As with all other retailers, everyone is free to set their own price. The price can be based on all sorts of parameters, which makes it impossible to say exactly why retailer A is xx$ cheaper or more expensive than retailer B.
It could be for example that a retailer has lower costs. For example having an online presence versus a physical presence is typical less costly. Similarly could spending different amounts on customer service, warranty repairs/support, etc.
It could also be that a retailer that is also the maker of the product wants to be in the market at a relatively high price in order to ensure that other retailers find it worth while to sell their products.
It could also be that one retailer earns money from other sources than the specific product sale - and that makes it possible for them to lower their price. For example by gathering data about the customer, or simply by having the customer browsing their web site making it more likely that they will buy other products from the same retailer.