You wish to buy a house in, say, a couple of years, so you want to start putting some money away. Where will you invest? A two-year horizon may be too risky to think of stocks. A debt product such as a fixed deposit offers more comfort in this case: it shields your money from market swings and offers assured return. To reach a goal so near in the future, capital protection may be the important focus; return on capital is perhaps incidental.
Now flip the argument and think of a long-term goal such as retirement, which is a good 10-20 years away. Where will you invest? A long-term horizon gives you more confidence to dabble in equities: over the long term, equity as an asset class tends to surpass all other asset classes. You could even look at long-term debt products that offer a real rate of return—above the inflation rate. The focus in this case should be to pick assets that enhance value and keep you ahead of inflation.