A subsidy can be explained as a "financial contribution" by a government or public body that confers a "benefit" to the recipient. This financial contribution can be by way of a direct transfer of funds by government (e.g. grants) or by way of foregone revenue (e.g. tax credits) and is provided on terms that are more favorable than would otherwise have been received under pure market conditions.
Often times, the benefit conferred upon the recipient (the consumer or the producer of the product being subsidized) is a price that is either below or above a benchmark / market price. In the case of a consumer subsidy, the price paid by the consumer is below the benchmark price; while in the case of a producer subsidy, the price received is above the benchmark. Where the product being subsidized is traded, the benchmark price is the international price of the good. However, where it is mostly non-traded (such as with electricity) the appropriate benchmark price is the cost-recovery price for the domestic producer.
Subsidies, ultimately, must be paid by someone. Where government fully incurs the cost of the subsidy, the subsidy will be reflected in the budget as an expenditure item and financed, for example, through higher taxes, increased debt, or higher inflation if the debt is monetized. Often times, however, the subsidy may be financed by state-owned enterprises (SOEs) and reflected in operating losses or lower profits, lower tax payments to government, the accumulation of payment arrears to suppliers, or non-performing loans to creditors.
While subsidies are aimed at protecting consumers, they have macroeconomic, social, and (in the case of energy subsidies) environmental consequences that render them inefficient.