Origins
A bargain was once the argument, not the outcome.βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Old French bargaigner meant 'to haggle, to negotiate' β the heated back-and-forth of commerce. The modern sense of 'something at a good price' only emerged later, as a natural consequence: if you bargain well, you get a bargain.
The word probably entered French from Frankish *borganjan, meaning 'to lend' or 'to pledge', connected to the Proto-Germanic root *burgijanΔ ('to keep safe'). This links bargain to an unexpected relative: borrow, which comes from the same Germanic family of pledge-words.
Development
In medieval English, bargain primarily meant a contract or agreement. 'To strike a bargain' was to seal a deal, not necessarily a cheap one. The phrase 'into the bargain' (meaning 'in addition') preserves this contractual sense β something thrown in as part of the agreement.
The 'good deal' meaning appeared around the 16th century and steadily overtook the original. Today, bargain hunters seek low prices, but the word remembers a time when the prize was not the price but the negotiation itself.