Betfair is different to traditional bookmakers as they allow lay betting. This means backing a selection to lose rather than win.
Every bet placed on a betting exchange involves two bets really - one bet backing the selection to win, and a second bet backing the same selection to lose.
Betfair has an API which allows 3rd party software to connect and place bets automatically either with or without human interaction. These are called robots (Bots).