When a person A decides to sell to open an options contract through his / her brokerage, I always thought that this results in an options contract being written on behalf of person A by the brokerage, which person A is obligated to fulfill in the event that another party buys and exercises the option. In this case, the other party would be opening to buy, I guess. But who buys the newly created option? Is it a market maker, holding on to it until another investor buys it retail? Similarly, if person A were to buy to open an option position, who would write the position? Does the option get written as a result of this action? Is a market maker or brokerage writing the option on the spot, or is it another person, call him / her person B, acting as an independent investor who has the option contract written when executing a sell to open action. If it is, in fact, another person, how does the brokerage firm find this other person when person A buys to open? Does the other person just put their written option up on the market for auction indefinitely?
I have the unnerving feeling that half of these ideas are probably wrong, but I do not know which ones...