A Market-on-Close (MOC) is an order to trade stocks, options or futures as close as possible to the market’s close. It is an order to be executed at the existing market price when the market is about to close. Large Institutions use this method to buy or sell big blocks of shares. Hence there is a general spike in volumes and/or prices of stocks towards the market closing time. Institutions generally buy or sell in large quantities around day closing when a stock is to be added or removed from an Index and the institution has to buy or sell the stock for an Index fund.
MOC orders are also used for day trades to close a position at the end of the session irrespective of the price.
It can also be used by retail investors for exiting a position but who want to utilise the complete upside in the stock price that day.