COVID-19: When the government's 'opaque' green, amber and red list decisions don't match the data

How does the government decide which countries are on the red, amber and green lists that determine which countries Britons should or shouldn't visit - or rather what kind of quarantine they have to undergo when they return?