An investor's portfolio should ideally have several asset classes and different assets within each asset class. When an asset is added to the portfolio it is expected to provide a certain return and there is also a certain amount of risk that is associated with the expected return.
With time, the risk-return profile of different assets changes. The expected return of some assets may go up with an increase or decrease in the risk; for others the expected return may have come down with a change in the associated risk.
This requires the assets in the portfolio to be altered accordingly to increase returns while keeping the associated risk at an acceptable level.
Portfolio optimization involves eliminating certain assets and substituting them with better alternatives that may have become available. An investor or portfolio manager has to constantly be on the lookout for such opportunities.
For example if a company has undergone a turnaround and turned profitable, it would make sense to acquire shares of that company while selling shares of a company that is not doing that well. Similarly if the portfolio has bonds and interest rates are expected to rise, the bonds could be sold.
Portfolio optimization involves a lot of mathematical modeling and calculations to determine the best choices among the available options. While altering a portfolio there are also several transaction costs involved which have to be kept in mind. As the transaction costs makes frequent changes unprofitable, all changes have to be made carefully and with a lot of thought.