Here's a good technical article on how the Bitcoin protocol works: http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html?m=1.

This is a follow-up by the same author on how mining works: http://www.righto.com/2014/02/bitcoin-mining-hard-way-algorithms.html