The login password/key can be set as the encryption key for files on your computer but usually, it's a separate password from your login password.
On an online banking site, files are encrypted so they can't be seen without your key/password. It's as simple as that.
As to the actual method of encrypting data, or creating a cipher for information, see the link below. Other such explanations can be found on the web by simply typing: "What is encryption" into Google or any other search engine.:
http://lifehacker.com/a-beginners-guide-to-encryption-what-it-is-and-how-to-1508196946
Hope this helps.
Grif
When I encrypted a file or a folder in my computer, is my login password an encryption key that allows me to open the encrypted files after logging in? Is this the preventive measure that the person who steals my computer and starts it in safe mode will be denied access to this encrypted files? If I do online banking on a secure site, how is the key created and how the bank gets the key to decrypts the information I send them? Please help me to understand this concept.

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic