Bach played for the Margrave, who enjoyed Bach's music. Bach offered to send some of his compositions to the Margrave upon his return to Cöthen. For various reasons (including the death of his wife) Bach put off sending anything to the Margrave until two years later. What prompted Bach to remember was the fact that Prince Leopold was engaged to a woman who did not care for music as much as the Prince did, and the rumor was that as soon as she was married she was going to use her influence on the Prince and have him disband his orchestra and release his musicians.
So Bach had six of his finest concertos bound together and he wrote a syrupy, pandering and overly-flattering dedication in French to the Margrave. He was basically sucking up to the Margrave looking for a job. There's no evidence that the Margrave ever had them performed, musical historians doubt that the Margrave's court had enough fine musicians to play the concertos. As for Bach, he moved on to Leipzig and spent the rest of his life there.
The first movement sees the three soloist dialogue with each other, with the harpsichord gradually garnering more of the spotlight with its music becoming more and more complex and decorated. The harpsichord becomes more and more demanding until the rest of the instruments give in and turn silent while the harpsichord gives us one of the best examples of Bach's prowess and improvising skills at the keyboard. The second movement is a gentle song played by the soloists only. The third movement is a lively gigue that rounds out the work.
This concerto is one of the first examples of a keyboard instrument having a solo part that was originally written for it, which paved the way for the classical piano concertos of Mozart and others.