1590s, "pledge as a forfeit to another who makes a similar pledge in return," originally in the argot of petty criminals, a word of unknown origin; see bet (n.), which appeared about the same time.
The intransitive sense of "lay a wager" is from c. 1600. It has been used since mid-19c. in various American English slang assertions (bet your life, 1848; bet your boots, 1856; you bet "be assured," attested by 1857 and identified in Century Dictionary as "originally California slang").