From what I've been able to determine, a bike manufacturer, who really only makes the frame and oft times now the cockpit and wheels, but never the groupset, typically marks up the added-on parts by about 100%. So a $750 groupset adds $1500, a $1500 groupset adds $3,000. So while the cost differential online between a mech and Di2 groupset could be $750, the resulting full bike price differential will be $1500 when sold built onto a complete.
OTOH, the frame-only options you can sometimes find, are sold for about 4-6x the manufacturer's cost, so they have leeway at the low end for aggressive pricing for the first level bike (eg. the example of the complete bike selling for only $300 more than frameset only).