Resource allocation in a free enterprise
Although there are no central committees organising the allocation of resources, there is supposed to be no chaos but order. The major price and allocation decisions are made in the markets. The market being the process by which the buyers and sellers of a good interact to determine its price and quantity.
If more is wanted of any commodity say wheat - a flood of new orders will be placed for it. As the buyers scramble around to buy more wheat, the sellers will raise the price of wheat to ration out a limited supply. And the higher price will cause more wheat to be produced. The reverse will also be true.
What is true of the market for commodities is also true for the markets for factors of production such as labour, land and capital inputs.
People, by being willing to spend money, signal to producers what it is they wish to be produced. Thus what things will be produced will is determined by the shilling votes of consumers, not every five years at the polls, but every day in their decisions to purchase this item and not that.
The "How?" questions is answered because one producer has to compete with others in the market; if that producer can not produce as cheaply as possible then customers will be lost to competitors. Prices are the signals for the appropriate technology.
The "for whom?" question is answered by the fact that anyone who has the money and is willing to spend it can receive the goods produced. Who has the money is determined by supply and demand in the markets for factors of production (i.e. land, labour, and capital). These markets determine the wage rates, land rents, interests rates and profits that go to make up people's incomes. The distribution of income among the population is thus determined by amounts of factors (person-hours, Acres etc) owned and the prices of the factors (wages-rates, land-rents etc).