Digital files and data are ultimately stored as ones and zeros, but how those bits are interpreted determines their meaning. A particular collection of digital information can be represented in many ways, and knowing the scheme by which the particular bits are meant to be understood will often be the key to usefully accessing a file. A digital file that has been compressed to take up less space on a hard drive, for example, cannot be read or written again until after that form of processing has been accounted for and reversed. While the information the file represents remains there all the while, actually making use of it can take a bit more effort than might be expected.
A process known as encryption leverages this fact in the most direct possible way. A file that has been effectively encrypted will not be readable at all to anyone who lacks the right key. While some especially weak encryption schemes can be reversed or broken through brute force, the most common ones are designed to resist such attacks. Some methods of encryption, in fact, are so strong that all the time left in the universe would not be enough to reverse them in the absence of the key, even if each and every atom was a high powered computer dedicated to the task.
When ransomware attacks lock up the files on a computer using encryption, the brute force approach is not generally likely to yield results. Even given this fact, however, it often turns out to be possible to decrypt encrypted files without paying the ransoms that criminals almost always demand. While a properly encrypted file might not be easy to decode through crude means like trial and error, experts have ways of recovering the keys that are needed.
In fact, quite a few common ransomware attacks can now be safely and effectively reversed by those who have the right mix of skills and knowledge. In some cases, criminals have been careless with their secret keys, while others have released them voluntarily. What matters the most to victims, in every case, is simply that gaining access to the information locked up in encrypted files does not need to mean giving in to the criminals who took it away in the first place.