Some of the cages were built during the Obama administration to hold an unprecedented number of unaccompanied migrant children--I think it was more than 69,000 that year--for no more than 72 hours before releasing them to the Department of Health and Human Services for further placement. Trump used them, and I think built more of them, to hold immigrant children, 40 percent of whom were not released to HHS in 72 hours or less. Many of those children were not unaccompanied when they crossed the border but became unaccompanied only when were taken from their mothers. Babies in diapers were taken from their mothers' arms. This was Trump policy, to separate families.
There are many sources for this information from nonpartisan and even foreign news outlets like the BBC.