One good resource for understanding on how Bitcoin works on a lower level is this article: http://www.samlewis.me/2017/06/a-peek-under-bitcoins-hood/
It goes through the details of creating a tiny Bitcoin client that can send transactions so that they will get included in the blockchain.