A June 2017 House of Commons Library briefing paper provides an overview of immigration detention in the UK (pdf).
It addresses long standing criticisms, as well as recent reforms designed to reduce the numbers of vulnerable people detained (and the duration of their detention).