The songbird that sings is much like the singing cotton pickers that harbored inordinate rage at their condition. For, both sing to keep themselves from total despair. In fact, "Sympathy" is a lyrical poem suggestive of a blues song in its melancholy.
The speaker of Dunbar's poem says that he "knows what the caged bird feels" as he sees the sun brightly shining, the wind stirring, and the river flowing. When the unfettered freedom of nature presents itself in contrast to his own condition, the speaker feels frustration at his own personal lack of freedom. Like the bird, he cannot be free, hindered by the bars of conventions of society. Instead, he "must fly back to his perch" and remain in his limited and oppressed environment.
And, yet, like the caged bird, the speaker must strive to attain freedom, he, too, must send a plea Heavenward that someday he will be recognized as an individual who deserves respect and opportunity. He must persevere, or else he will surely die.