A ransomware is a software that encrypts data found on a system. Once the data gets encrypted in wrong hands the victim is demanded a money i.e. ransom.
To say it shorter, a hacker gets your information and demands a ransom. The hacker will take the information and won’t give it back until you give him what he or she wants.