Short-term rates were near 0, but Long-term rates were 1.x%, which doesn't sound like much but keep in mind they bought tens of billions of dollars of these bonds.
That 1.x% on that huge amount would be over $1 Billion per year.
It's a mismatch in terms of the duration, ie your depositors can ask for their money back at any time but the bonds don't mature for many years, but as long as the deposits are kept there the bank can get away with it.