I feel that Maya Angelou is using this to symbolize how blacks felt in her day. A caged bird has no freedom it cant go outside and fly freely, but it still sings to show that even though its trapped it can still find joy. That is what Maya Angelou is trying to say here. Even if blacks were going through difficult trials and were in pain they could still find joy by showing their pain in song. It gave them hope for a better future and helped them get through their troubles.
Hope this helps! (Not sure if this is what you wanted or not-)