Prices of securities do not always move in a correlated way, whether they be stocks, bonds, or any other type of security. A price decrease in one security can be offset by a price increase in a different security, and the more securities you mix into a portfolio, the greater the probability of this offsetting price movement. Therefore, by mixing more securities into a portfolio of investments, the overall risk (measured in terms of portfolio variance) will be dampened by these offsetting price movements. However, the expected returns of each security, and thus the expected return of the portfolio remains unchanged. Thus diversification offers investors a way to obtain the same expected return with lower risk and variance in their returns.
A simple example may help clarify the concept. Suppose you live on an island, and you want to invest in toy companies for children. There are two extremely similar toy companies (Company A and Company B), selling similar toys, and both companies' toys are equally popular.
If you do not diversify, you buy stock in only Company A. If a firm specific risk negatively impacts Company A, such as its factory burns down, then you will have a major loss, and investors in Company B will have a major gain since it would become the only toy company left. However, if you diversify and buy stock in both Company A and Company B, then the large loss in Company A will be offset by the equally large gain in Company B. Notice that by diversifying, an investor is able to reduce the unsystematic risk, the risk associated with only a single company (in this case the risk of fire). Systematic risk cannot be eliminated by diversification.  For instance, if children no longer like to play with toys, then the entire market for toys has been adversely affected, and not simply an individual firm. In the case of systematic risk, diversification cannot reduce this risk; diversification can only reduce unsystematic risk.
There are limits to how "diversified" a portfolio can get. More diversification can always be achieved by adding more and more securities to a portfolio, and in theory a portfolio is not fully diversified until you hold investments in every security that exists in the world. More practically, there are clearly decreasing marginal benefits to diversification. For stocks, generally accepted numbers are roughly 25-30 stocks to achieve sufficient diversification. Because it is costly to diversify, individual investors may find index funds, closed-end funds or mutual funds an attractive option to buy a share of an alrjutineady well diversified pool of investments.
Also, as noted in the example before, diversification can only reduce unsystematic risk. No amount of diversification can reduce or eliminate systematic risk, which affects all of the markets at the same time.
Is the process of spreading the total investment money available across different asset classes, countries, industries, and individual companies. Diversification also entails choosing investments that are, as far as possible, uncorrelated, which means that when investment A is performing poorly, investment B is likely to be performing well.  A prudent investor diversifies their holdings in a diversified portfolio of assets.