aka "When the Morning Comes" or "Trials Dark on Every Hand". First published in "Soul Echoes: A Collection of Songs for Religious Meetings". The song is a standard Protestant hymn. "By and By" is the standard idiom for eventually, at some future time, ultimately, finally.
Refrain: By and by, when the morning comes, When the saints of God are gathered home; We will tell the story how we've overcome; We will understand it better by and by.