Are sales (discounts) an investment or a loss? Are sales (discounts) during a promotional period considered an investment by the company/manufacturer to drag in more customers? Or a loss that wouldn't be paid back anytime in the future, but also drags in customers? If its the former (i.e investment) how do they pay back the money that's being discounted?

e.g A product officially costs 100USD. There's a sale for that product for 50% off (so that product is now 50USD), how do they make profit or get back that other 50USD?
Suppose that the wholesale cost of the product is 40USD, and the maximum price that most customers are prepared to pay for the product is 50USD, but a few customers are prepared to pay 100USD for the product. Suppose also that the few customers who are prepared to pay more for the product will put less effort into waiting for discounts. Suppose also that some customers are more likely to buy a 50USD product if it previously costed 100USD than if it had always costed 50USD. 

What would be the optimal pricing strategy in this circumstance?