In margin trading, you take buy/sell positions in stock(s) with the intention of squaring off the position within the same settlement cycle. If during the course of the settlement cycle, the price moves in your favor (rises in case you have a buy position or falls in case you have a sell position), you make a profit. In case the price movement is adverse, you incur a loss. However, you also have the option to take/give delivery of buy/sell position respectively if you have sufficient cash/securities to do so.
Normally to buy shares, you have to place (ensure availability of limit) 100% of the order value, while to sell shares, you need to have shares in your Demat account. However, margins are blocked only to safeguard against any adverse price movement. With margin trading, you can leverage on your trading limit by taking buy/sell positions much more than what you could have taken in the cash segment. However, the risk profile of your transactions goes up.