The way I had it explained to me is that there are two competing currents in the law.
The first is that people are intelligent rational beings, deserving of respect and independence. If an adult makes a decision or takes an action, they should be held to the consequences (good or bad) of their decision or action. If you enter into a contract you should fulfill it, or suffer the consequences.
If you don't, you are basically saying, I think you are a child - I don't think you have the competence required to make decisions, and I am removing your agency. You are disrespecting them.
Built into this view is an assumption that there is a roughly level playing field. An example of this is two business people or two corporations negotiating a contract.
The competing view is based on an assumption the playing field is not level and there are power dynamics that make a true bargain between equals impossible or unlikely. An example of this would be a waiver printed on the back of a ski lift ticket in tiny print or a undocumented / illegal migrant trying to negotiate a contract with a farmer, or getting someone drunk and then having them sign a contract.
Holding the weaker party to a contract in these cases seems cruel or unreasonable.
The role the law plays depends on which view you adopt. Canadian courts have tended to adopt the first view when dealing with business people and corporations and the second when dealing with consumers. Sometimes the law is concerned solely with making the process of entering into the contract fair (stopping people from lying or misrepresenting, or threatening) and sometimes (rarely) the law is concerned with the substance of the contract (were the terms fair). A good lawyer will harness one or more of the underlying viewpoints that the law is built on when framing your case and then tie that to an existing common law remedy / doctrine.
A good introduction to all this is Lord Denning's decision in
George Mitchell (Chesterhall) Ltd. v Finney Lock Seeds Ltd. (
http://www.bailii.org/ew/cases/EWCA/Civ/1982/5.html - look for
The heyday of Freedom of Contract) - Depending on your point of view he was either a power mad meddler or the best jurist of the 20th century. He had a clear view of how he wanted the world to work and used his position to modify the common law to enact that vision.
Thornton v Shoe Lane Parking Ltd (
http://www.bailii.org/ew/cases/EWCA/Civ/1970/2.html) is another classic Lord Denning protecting the consumer case.