Buying the put gives you the right to sell the stock at strike price A. Because you’ve also sold the call, you’ll be obligated to sell the stock at strike price B if the option is assigned.
You can think of a collar as simultaneously running a protective put and a covered call.. Some investors think this is a sexy trade because the covered call helps to pay for the protective put. So you’ve limited the downside on the stock for less than it would cost to buy a put alone, but there’s a tradeoff.
The call you sell caps the upside. If the stock has exceeded strike B by expiration, it will most likely be called away. So you must be willing to sell it at that price.
Many investors will run a collar when they’ve seen a nice run-up on the stock price, and they want to protect their unrealized profits against a downturn.
Some investors will try to sell the call with enough premium to pay for the put entirely. If established for net-zero cost, it is often referred to as a “zero-cost collar.” It may even be established for a net credit, if the call with strike price B is worth more than the put with strike price A.