Originally, it refers to kidnappers demanding payment for the release of someone they've captured. In movies, criminals often hold someone to ransom until their demands are met.
Pro Tip 2/3
Metaphorical Sense
It's used metaphorically to describe any situation where someone is forced into a choice by severe threats. The employees felt held to ransom by the threat of layoffs.
Pro Tip 3/3
Negative Connotation
The phrase often implies an unfair or immoral power imbalance. The software company was accused of holding its clients to ransom with expensive updates.