Can you explain to us how the accounting is done?
Yes though you are asking a bigger question than you may realize.
If I buy a part 20 years on for a vehicle for which I'm not even the first owner, and it's a part which can fit 20 different vehicles, how do you account for the profit?
Whose profit are you trying to account for? The manufacturer of the part? The OEM who built the car? The dealer? For OEM parts the OEM (think Ford or GM) will purchase the parts from a supply chain during the production run and they will usually contract for several years worth of replacement parts in addition to the production run - usually something like 3-7 years worth. Once the original production run ends it usually moves into aftermarket manufacturers, sometimes custom replacements or sometimes the original manufacturer will continue to produce the part for some time if there is a market for it. It's not unheard of for the OEM to keep the supply chain for replacement parts running for 15-20 years though that isn't the norm.
You don't have accurate statistics on failures on vehicles that old, because people don't bring them back to the dealer for service.
Actually dealers do see a lot of older vehicles for service so they have pretty decent information. Aftermarket parts dealers also have a pretty good idea what parts fail commonly on which vehicles. Furthermore the parts that are failing in year 5 are mostly going to be the same as the parts failing in year 20 with a few additions.
From my various forays into automotive parts replacement and part ordering, I know that without exception the manufacturers charge absolutely abusive prices for replacement parts.
Actually it isn't usually the manufacturer charging the outrageous markup, it is the dealer who is independent. (And you are right, it is outrageous) The OEM usually charges the dealer a 10-40% markup. Anything you buy from a dealer typically has a minimum of an 8X or more markup over the actual manufacturing cost. To give you an example, my company makes a jumper harness for a GM vehicle. Costs us about $3.00 to make it and we sell it for roughly $4.00. We are a Tier 3 so by the time it gets to GM it probably costs somewhere around $6-8 once you factor in the markups along the way and they probably double the price they sell to a dealer. If you were to march into a dealer and try to buy our part by itself from a dealer it would cost you somewhere between $30-50 if they would even sell it to you as a standalone product which they probably would not. I've seen assemblies that cost $3 to actually make selling for $200+ and the majority of that markup comes from the dealer.
You're telling me that having more expensive parts doesn't lead to more profit?
No, I said a larger part count for the OEM generally leads to less profit. Increasing part counts has no benefit to the OEM. Ford has competition and they cannot simply pass on any markups to the car buyer. In essence they have a cap on how much the can sell the car for. If they make a more complicated part that will cost more to make, it will break more often and sooner and Ford will make less profit. There is a limit to what they can charge for aftermarket parts too though the price elasticity is less sensitive. If a car constantly breaks people tend to get rid of the car in the long run. Furthermore the reputation benefits foregone in lost sales alone far outweigh any minor additional profit from more expensive replacement parts.
Automakers derive significant profit from parts sales, and EVs both have less parts and are less prone to failure than vehicles with ICEs.
They do get some profit from part sales but only after the warranty runs out and not nearly as much as you probably think. The expense of recalls from failures can easily swamp any profit from a vehicle line. Even the most profitable vehicle manufacturer has a net profit margin no higher than 8-10% and most are somewhere around 5%. Do you have any idea how easy it is for 5% net profit to vanish? Car manufacturers make most of their money from selling and financing cars. Parts might help but most of that profit accrues to the (independent) dealer network rather than the manufacturer.
We've been driving production hybrids for fifteen years now. We already know the best way to do it, you replace the torque converter of an automatic transmission with an electric motor. In spite of that, people are still doing it in other ways which cost more money, and which increase parts count.
If you think the technology in hybrids is mature you are very mistaken. It's evolving quite rapidly and the technology is still highly non-standard. I defy you to find an engineering consensus that there is a "best way to do it" and certainly nothing as simple as just swapping out the torque converter. That might be your opinion but it isn't a widely shared one. Hybrids are expensive because there is a lot of engineering and tooling costs that have to be recouped and the sales volumes aren't big enough yet to fully amortize the fixed costs away.