If you are an assured shorthold tenant, the predominant type of tenant in the UK, then when you pay a deposit to your landlord or letting agent it will be entered into deposit protection scheme. A deposit is paid for security against the damage of the property or for refusal to pay rent.
A deposit protection scheme such as the Deposit Protection Service, MyDeposits or the Tenancy Deposit Scheme ensures that at the culmination of the tenancy that you as the tenant will get your deposit back (as long as the property is not damaged in any way above normal wear and tear).
Normally the tenant will only have their tenant retained if they damage the property or fail to pay their rent at any point during the tenancy. In these instances the landlord is well within their rights to keep the deposit, or deduct from the deposit the amount that must be recouped.
The schemes available to landlords include The Deposit Protection Service, MyDeposits and the Tenancy Deposit Scheme. They differ in that the first is custodial based meaning that the scheme holds the deposits for the entire tenancy in an independent bank account, the other two are based on the landlord taking an insurance policy to protect the deposit, although it remains in their private bank account.
As a tenant your deposit should be protected within 14 days of payment and in this time your landlord should provide you with details of which scheme is being used as well as other details of the letting. At this time it is typically advisable to speak to the landlord to agree the state of the property at the start of the tenancy also that there is a benchmark from which repayment can be based.
Ultimately the major benefit to tenants is that a deposit protection scheme has made it far harder for unscrupulous landlords to simply refuse repayment of the deposit. They also ensure that if there is a dispute, a fair and logical process is followed to decide which party is in the right and how much of the deposit needs to be repaid.