The Confederate Army’s retreat moved southwest along the Richmond & Danville Railroad. Lee desperately sought a train loaded with supplies for his troops but encountered none.
Grant, realizing that Lee's army was running out of options, sent a letter to Lee on April 7 requesting the Confederate general's surrender.
When the confederate army retreated, they kept on moving southwest. Lee realized that there were no trains with supplies for the army. Grant found out and wrote a letter to Lee asking the army to surrender. This is how the army was lead to surrender.