A right of first refusal gives the company and the other shareholders the opportunity to buy the shares before they are sold. This is how it works.
Shares in a closely held corporation are typically not marketable. Very few investors want to become a shareholder in a closely held corporation. This creates the problem of determining how a shareholder can get out of a closely held company at a fair price. One way to deal with this problem is a put right along with a right of first refusal.