I don't think we can trace moon planting back to it's original source, but the ancient Egyptians were known to use the lunar calendar when farming as well as the Babylonian's. Man has used the sun, the moon and the stars to tell time, days and to navigate so it is not much of a jump to hear that the moon could help you farm.
It is apparent the different plants grow better in certain phases of the moon. In the same way that the moon affects the tides, it affects the moisture in the soil, pulling it to the surface. Some plants need to concentrate on the root system more than others and some have to put more effort into the leaves or fruits above ground.
A rough guide:
There are three methods for planting by the moon. The Synodic, or waxing and waning cycle, the Sidereal, and the Biodynamic cycle. The simplest one being the Synodic method. This is the only one I have ever used, I have had success with this method, and I often wonder when friends tell me something along these lines: 'The first seeds I planted grew really well but the next lot were small and some died' if it was just down to the moon phase.
At the new moon (cannot see a moon, or only a small crescent on the right), the lunar gravity pulls water up, this is good for above and below ground growth. This is the best time for planting above ground annual crops that produce their seeds outside the fruit. Examples are lettuce, spinach, celery, broccoli, cabbage, cauliflower, and grain crops. Cucumbers like this phase also, even though they are an exception to that rule.
In the second quarter (right hand side crescent moon up until full moon) the gravitational pull is less, but the moonlight is strong, creating strong leaf growth. The types of crops that prefer the second quarter produce above ground fruits with their seeds inside, such as beans, melons, peas, peppers, squash, and tomatoes. Also this is a good time to mow your lawns if you are trying to increase growth.
After the full moon, as the moon wanes, the energy is drawing down. The gravitation pull is high, creating more moisture in the soil, but the moonlight is decreasing, putting energy into the roots. This is a good time for planting root crops, including beetroot, carrots, onions, and potatoes. It is also good for perennials, biennials, bulbs and transplanting because of the active root growth. Pruning can be done now as well.
In the fourth quarter (crescent moon on the left) there is decreased gravitational pull and moonlight, and it is considered a resting period. This is also the best time to cultivate, harvest, compost, transplant and prune. Mow lawns in the third or fourth quarter to retard growth.
I recommend giving this a go, I think it speeds things up and gives good results. For example if you plant carrots after the full moon the root system is drawn down sooner, and the root just happens to be the desirable part of the plant.