Custody is about responsibility.
There is a chain of custody for evidence, showing who was in possession at any given time. A bank might have custody of a financial asset.
And someone under arrest or convicted could be in the custody of police or a jail…