How did 'consideration' semantically shift to mean 'something given in payment'?
Consideration in contract law today is considered (at least one element of) the essential defining elements of what a "contract" is in the first place, and that there must be of something value given in exchange of the promise of the one thing for the other. Contracts that "fail" for lack of consideration, are not strictly speaking enforceable, or may be considered void or at least voidable, as nothing of value was offered in exchange. This is the legal essence of the term "consideration." It is easy to see how this term went from a "term of art" in the law, as it is called, to a more general sense of "regarding or thinking about something," but that is non-specialized use of the word consideration. There is not properly speaking a "semantic shift" as both meanings perpetuate in the English language today, one as a "term of a art" in the law, and used by legal professionals, the other used by everyday persons talking about the more common meaning.
I think the missing piece is with the legal definition of consideration:
Say, for example, that your neighbor admires your bicycle. You know you are moving soon, so you offer (an "offer" is an element of a contract) to sell it to her for $100 (consideration). She accepts your offer (acceptance is also an element of a contract), but can't pay you until she goes to the bank. So, you scribble a quick note describing both of your intentions to enter into this agreement and hand her a copy of the note. You now have an enforceable contract because the elements of a contract are in place, including this "bargained-for" exchange.
While a consideration can be money, it doesn't have to be. In fact, it wasn't at first. According to the OED:
At its first appearance it is hardly a technical term, or distinguishable from motive; it gradually acquired its precise technical meaning in the course of the 17–18th centuries. Natural affection was formerly called good consideration, as contrasted with valuable consideration
The first appearance the OED refers to is this quote from 1530:
Yf the promyse be so naked that there ys noo maner of consyderacyon why yt sholde be made, then I thynke hym not bounde to performe yt.
(Translation: If the promise be so naked that there is no manner of consideration why it should be made, then I think him not bound to perform it.)
St. Germans Secunde Dyaloge Doctour & Student
From there it should be easy to see the connection with another even earlier (c1460) definition of the word (also from the OED):
The taking into account of anything as a motive or reason; a fact or circumstance taken, or to be taken, into account; a reason considered.