A keylogger is a type of malware that captures your keyboard keystrokes. Keyloggers allow hackers to learn your passwords, credit card numbers, authentication credentials as you visit sensitive websites such as banking portals, email messages contents, etc.
Keyloggers save all of your keyboard input so that the bad guys can review it. When you enter in your credentials online, the information is usually encrypted as it submitted over the network. However, keyloggers bypass this encryption because it captures keystrokes which are not encrypted.
Keylogger can not only capture what you type, but there are also keyloggers that can capture everything that you save to the clipboard, or they can save screen captures, instant messaging logs, search engine queries, etc.