Rav Huna holds that if one is coerced to sell property, the sale is never the less binding. [The reason for this is that a person will feel that he has no choice, and he might as well give up the property and take the money.] The Gemora says that all sales are done under duress and nevertheless, they are binding. [People only sell when they need money but they really have no desire to sell.
The Gemora asks on this logic. There might be a difference when the coercion is not internal, but coming from someone else.
Perhaps it is from the following braisa: It is written regarding a sacrifice: He shall bring it. This teaches us that we force him to fulfill his obligation. Perhaps, you might think that he brings the korban even against his will. The Torah writes: Of his will. This teaches us that we compel him to bring the sacrifice until he says that he is willing to bring it. [This shows that one can be forced by others to do something willingly, and is therefore a source for the law that a forced sale is a sale.]
The Gemora rejects this proof: Perhaps there it is different, for everyone wishes to receive atonement (and he is really willing to bring the korban).
Rather, it may be proven from the latter part of that braisa, which states: And the same is true regarding a letter of divorce and the emancipation of slaves. We compel him to give the get (in cases where he is required to do so) until he says that he is willing to give it. Evidently, the divorce and emancipation is valid even though, in his heart, he is not truly willing. This proves that words that are only in the heart are not regarded as words.
The Gemora rejects this proof: Perhaps there it is different, for he has a mitzvah to listen to the Chachamim (to issue a divorce or to free his slave).
Similarly, the Rambam discusses a case when a person is obligated to divorce his wife due to the ruling of Beis Din. When he refuses, he is beaten until he says that he is willing.
The Rambam asks: How can a get that is given by force be ruled to be valid? A coerced get is not valid at all!?
He explains that it is only considered “forced,” if a Jew is compelled to do something that the Torah does not obligate him to do. However, if he is compelled to do something that the Torah instructs him to do, this is not considered “forced.” The explanation is as follows: A Jew wants to perform all the mitzvos and distance himself from all sins, but his evil inclination convinces him to do otherwise. When he is beaten, his evil inclination is broken and when he says that he is willing, it is his actual intent and the get is valid.