It seems that the answer should be a general function of total mileage, and since I can get 200,000 miles out of a car these days without extraordinary effort, it seems like 20 years (at 10,000 miles per year, if that’s anywhere near ‘average’) is not hard to achieve.
But that’s a passenger vehicle used on paved road, as @kritiper notes, and with responsible “adult” use. Pickup trucks used in industry or commerce have a much harder life; the pickups that we sometimes buy for use on construction sites are sold after the project ends for little more than the salvage value, and those buyers tend to use them on farms and hunting land, more rough use. They may not see the odometer turn even once. On the other hand, with only occasional rough use of not too many miles, they may last for decades, too.
The “electronic, computer garbage” that you seem to decry doesn’t age vehicles; in many cases it helps to alert drivers and owners to maintenance issues before they become engine killers. Automotive computers tend to be pretty robust, I think.