From Joseph Fielding McConkie & Craig J. Ostler's Revelations of the Restoration, p. 154-55:
As early as June 1829 Joseph Smith asked Oliver Cowdery to formulate an expression of basic principles and practices of the soon-to-be-organized Church. Oliver in turn asked the Prophet to inquire of the Lord about what he should do. Doctrine and Covenants 18 was given in response to that request. In the revelation Oliver was directed to rely upon the teachings "concerning the foundation of my church, my gospel, and my rock" (D&C 18:4) as contained in the Book of Mormon. Drawing upon the principles in the Book of Mormon, Oliver submitted a manuscript to the Prophet. "Then Joseph Smith, or both he and Oliver Cowdery, revised that document. They put it in the format now found in section 20" (Woodford, "Articles and Covenants," 264-65).
Section 20 binds together a number of sepearate revelations. It appears that verses 1 through 4, which designate the day upon which the church was to be organized, were given early in April 1830. Other sections of the revelation were at least influenced by Oliver's draft and may have existed before that date. Section 20 is divided into distinct discussions concerning the brief history that preceded the Church organization, a declaration of beliefs, requirements for baptism, duties of priesthood offices and members, ordinances of the Church, and record keeping. This revelation and section 22 became known among the early members as the Articles and Covenants of the Church.
This didn't strike me as particularly interesting until I read the heading to Section 20, which quotes Joseph Smith as saying "We obtained of him [Jesus Christ] the following, by the spirit of prophecy and revelation, which not only gave us much information, but also pointed out to us the precise day upon which, according to his will and commandment, we should proceed to organize his Church once more here upon the earth."
When I imagine the Prophet obtaining a document from the Savior, I imagine a direct stream of words that come out of his mouth and are written down on paper, with the exact wording flowing. This, of course, is something that has never happened to me. There are times when writing talks or lessons where certain phrases or ideas flow quickly, but never an entire lesson; those come bit by bit--I take all of my study and impressions and thoughts, organize them over a period of time, pray about them, and ultimately settle on something I feel good about. It takes time and work and sometimes some agonizing, all of which is hopefully inspired by and approved by the Lord. And guess what!? That is how this revelation came about! Not to mention that the prophet had human help--Oliver Cowdery did a draft of the composition.
It is funny as I grow to find so many of my childish imaginations demystified. Prophets are people just like me. Much of their revelation is received in the same ways that I have received revelation, the only difference between us being the scope of our relative stewardships. It is encouraging to think that I can receive revelation just as they can, and also humbling to know it because it means I am just as responsible to put in that effort.
*Silly side-note: another mystical image I came across while reading to the littles: in the Book of Mormon reader, all of the men in Nephi's family have beards, but Nephi is clean-shaven. Funny that we have to portray a clean-shaven hero/protagonist, even though as a Jewish man in that time period, Nephi probably had facial hair. Tee hee.