Every piece of material has a labor unit, and a cost of material associated to it.
One outlet-
J-box
Receptacle
Wire nuts
connector
romex
Each item has a value in the form of time of how long you will spend fooling with it get it installed plus a dollar value for the cost of the material.
A short cut is to add all that together and figure an average distance for the romex and then formulated a labor unit and cost per outlet.
Labor units are something you can buy in a book on estimating. DO NOT USE RS Means for estimating the units are way too high, only use RS Means for change orders.
In a nutshell that is how it work, I would love to wax on and on about it but I have babies to put in bed.