What do antiviruses actually do when quarantining a malicious threat? Does it compress the file using some algorithm, does it just change the extension of the file, or does it just move the file to a safer location?
It is a place in your computer, which kinda acts as a prison for viruses infected your computer which were later arrested by your antivirus software.
Quarantine is a function of antivirus software that isolates infected files on a computer's hard disk. Files put in quarantine are no longer capable of infecting their hosting system.
A quarantined file isn’t deleted. It shows signs of infection, but by being in quarantine, the file has no opportunity to infect your computer. It’s safe. If the file can be fixed and the infection eliminated, the file can be removed from quarantine and put back into service. Or, if the file was falsely identified as being infected, it can be removed from quarantine and reused right away.
As said by Kaspersky:
Quarantined files are stored in internal binary formats. So they cannot be a threat.