I'll in sequence state the steps for one hypothetical problem to make everything clear and hope that helps you to understand. Suppose for simplicity that we deal with European call right now.
1) Someone goes to the IB and buys the call option on the XYZ common stock. So IB has shorted the call and puts itself in such situation:
As you see the loss is unlimited as XYZ (or spot) price moves beyond strike. But investment bank doesn't take any risk, thus is only compensated for the service it provide to clients - to be more specific- selling call option. But in this figure we see that IB not only has the risk of loosing money - but it has unlimited risk of loosing. For example if spot price reaches $135 the corresponding loss will be $1500. For $140 spot there will be a loss of approx $2000 and so on. So it has to hedge the position. In this case by delta hedging.
2) Delta hedging strategy:
That said, IB has to purchase the opposite moving shares (opposite of call). What can you think of such assets are? - Underlying shares themselves right?! YES. So it buys the shares and now it is in the following position. Please don't pay attention to the price scale it is another stock I found, but for the sake of illustration its ok:
As you see the possible spot price increase is eliminated by the shares holdings. So IB is in a riskless position. That is, whatever happens to the spot price, IB always receives 0 return after expiration. So we have perfectly hedged the short position by going long in underlying shares. As I have suspected, you probably came up with the question: What amount of shares does IB purchases(longs) in order to hedge the position. The answer is, this amount:
And it's logical. Suppose what happens if IB doesn't exactly longs the delta amount of shares. First case: it buys more than delta shares. Then it has run into the underlying risk, of course IB is holding more than necessary for hedging and if underlying ZYX goes down, it losses. Second, if it longs less than delta amount then it hasn't fully hedged position in short call and has the possibility of loss on the number short calls which haven't been hedged. Put another way, shares weren't enough to eliminate all short calls' risk.
3) We reach the expiration date.
When the expiration date comes and Option expires, IB has a 0 gain regardless of anything that has happened. Spot price increase/decrease possibilities have been hedged by finding opposite moving assets(in this case underlying shares). So you might have come up with another question: Is Investment Bank such stupid that he operates till the expiration date for you and receives 0 gain? Answer is: Of course not. Black-Sholes or binomial method calculates a FAIR price to be paid on option. So again, if the premium of call option quoted on CME is $2.30, you must assume that this is not a fair price, rather, it is a fair price (derived by BS or Binomial) plus the service charge IB conducts called transaction fee. So when you purchase option, you pay both $2.00 fair premium and + $0.3 transaction fee.
4)Here they (IB and client) have already broken the relationship since expiration date has been passed. But you might have another question. How often does the delta hedging occurs? This is completely another topic and if you are interested tell me and I'll try to provide such steps. But typically after the opening day, they know the previous day's close prices and so they immediately hedge in the morning every trading day till maturity comes.
Back to your question :
I understood everthing except "where delta is the first derivative of black-sholes formula on spot."
Is it that you confused with financial derivatives(instruments) with mathematical derivative?
Again, delta is the mathematical derivative of blacksholes formula(option price) with respect to spot(underlying).
Hope you got the point of delta hedging.
Regards
Tsotne