There are fixed costs and variable costs for production. Creating the dies and molds is a very large fixed cost which gets spread across all units created. Based on the size of the part, estimated tolerances required for successful operation, and other factors, an estimated die or mold cost could be created.
The material, electricity, and labor are variable costs of production, all of which can be quite easily estimated.
Now, on the rear view mirrors they had cost down to the penny. Unless they have some other datasources they're using, I'm guessing it's an estimated cost. Unless I learn more, I'd be skeptical of those prices. I'd be more comfortable if they posed an estimated cost per component and rolled it up into an estimated cost for the rear view mirror assembly.