When you sign a tenancy agreement, you usually hand over two chunks of cash: the rent in advance, and the security deposit.
Historically, landlords simply put the deposit in their own bank account. If they argued you broke something, they'd just keep the money. The law now prevents this imbalance of power.