Twain offered to publish Grant's memoirs and give him 75% of the profits. Grant was dying of cancer at the time, was in financial trouble and needed money for his family. Twain was also suffering a financial setback, so his offer was very generous.
Grant died shortly after the completion of his memoirs and Twain honored the agreement. Grant's widow received around $400,000 from the deal.