Large investments such as the purchase of an expensive item of capital equipment are examples of capital expenditure and do not factor into a firms profit or loss. Investments can take considerable time and expense before they start generating cash. With any investment the initial cash flow is negative, before (hopefully) becoming positive.
For example, building a new factory to produce Product A will require considerable cash outlays in terms of production costs, and considerable time before the factory is finished, Product A is being made, stocked in stores and sold to customers - when eventually cash will start to flow into the business from the investment. It is only when Product A starts selling to customers that a profit can be booked.