By midday of the fourteenth of Nisan, every Jew must have disposed of the ĥametz in his possession. In the past, Jews would plan their food purchases and their meals so that by Pesaĥ they would have finished consuming any ĥametz foods and thus not have to dispose of large quantities. They would leave only a small amount of ĥametz with which to fulfill the mitzva of bi’ur ĥametz in the best possible manner: by burning it.
However, occasionally one’s plan would backfire and he would find himself possessing a large quantity of ĥametz when Pesaĥ arrived. In such a case, if he did not mind losing the ĥametz, he could burn it or give it as a gift to a decent and deserving gentile. If he did not want to lose the value of his ĥametz, he could sell it to a gentile before Pesaĥ, since, as long as the prohibition has not gone into effect, it is permissible to sell the ĥametz and receive its full value. The prohibition against deriving benefit from ĥametz goes into effect on the sixth hour on the day of the fourteenth of Nisan, and until that time it is permissible to sell the ĥametz.
This was especially important for food merchants who would remain with large stocks of ĥametz before Pesaĥ and had no choice but to sell to a gentile, in order to avoid great financial loss. Even if a gentile could not be found who was sincerely interested in buying all of the ĥametz, the Sages teach that it is permissible for a Jew to say to a gentile, “Even though you do not need so much ĥametz, buy all of my ĥametz for the full price, and if you want, I will buy it back from you after Pesaĥ” (based on t. Pesaĥim 2:7).