Apple’s only structural advantage should be their custom silicon, but I don’t think that’s a cost advantage as much as it’s a performance and battery life advantage. Apple is still buying huge dies from TSMC and designing them custom themselves which is not cheap. Lenovo shares the cost of designing an Intel, AMD, or Qualcomm chip with dozens of OEMs. Same deal with software: I wouldn’t be surprised if macOS costs more per unit for Apple than Windows costs for Lenovo considering all the employees Apple hires directly to develop it.
Apple in theory should be paying a pretty similar amount of money to make the rest of their systems. They don’t make camera sensors, displays, keyboards, DRAM chips, or anything else themselves.