Robert E. Lee and Ulysses S. Grant emerged as the supreme commanders of the Confederate and Union armies respectively by 1864. Like many generals in both armies, both men were educated at the United States Military Academy at West Point, which Lee attended in the 1820s, about twenty years before Grant. Both men, like many other Civil War officers, gained combat experience in the war with Mexico in the 1840s. Once the Civil War began, both men rose through the ranks through their military successes, with Lee emerging as the commanding general of the Army of Northern Virginia by 1862 and Grant, who won pivotal battles in the western theater of the war, as the Lieutenant General and commander of all Union armies by 1864.
Despite these similarities, Lee and Grant were different in many important ways. Lee was the son of an old, prominent Virginia family, though it was in decline by the time he was born. Grant was the son of an Ohio tanner. When the Civil War broke out, it emerged that Grant and Lee had very different concepts of duty. Lee, offered the command of the United States army by President Abraham Lincoln, declined the appointment, feeling that he owed his talents to his home state of Virginia. Grant, on the other hand, having left military service, received a commission to serve in the Union army immediately.
Lee was also thoroughly the product of a slave-holding society and owned dozens of enslaved people on his plantation in Arlington, Virginia. Grant was not an abolitionist—he actually held one enslaved man in the years leading up to the war—but the war made him an opponent of slavery.
In terms of military tactics, both men were bold, decisive leaders. Lee is generally more praised for his tactical approach to particular battles, especially Chancellorsville, while Grant tended to be a more methodical leader, relentlessly putting pressure on the Confederate armies in order to exploit the numerical and material advantages that the Union possessed. To what extent these differences in approach were dictated by strategic concerns, as opposed to personality, is an open question.