How do the UK's terror threat levels work?

Threat levels are designed to give a broad indication of the likelihood of a terrorist attack.