Assignment happens when the buyer of an option exercises their right to buy (for a call) or sell (for a put) the underlying asset, and the seller of that option is required to fulfill the contract.
For example, if you sell a call option with a strike price of $50 and the buyer exercises it, you’re assigned the obligation to sell the underlying stock at $50 per share, regardless of the current market price.
Similarly, if you sell a put option, you might be assigned to buy the stock at the strike price. Assignment typically occurs when an option is in-the-money at or near expiration, but it can happen earlier. As long as the option has extrinsic value, the probability of assignment is minimal.