It's quite simple. Bitcoin company sends you a problem to solve, your computer automaticly solves it (with others if you're in a mining pool) and send back the answers. and in return you get Bitcoins.. Win win!