The roots of the word are the least ambiguous or disputed aspect of it so we can begin quite simply. Dharma is derived from the verbal root √dhṛ ' to hold, to bear, to carry'. The basic verb form is dharati - the root takes the guṇa and the stem becomes dhar-. The derivative dhárman  is a neuter verbal noun, with the addition of the suffix -man, and means 'support, foundation'. It is this form - dhárman - which corresponds to Classical Sanskrit 'dharma' which we are interested in (note that Pāli collapses the conjunct rma into the double consonant mma to give us 'dhamma'). Dharma only occurs 67 times in the Ṛg Veda (RV) and only used 65 times in the rest of the vast Vedic corpus including the Upaniṣads. This suggests it is a minor term, of dwindling importance - a fact that must be explained given the centrality of the term in Indian religion today!
Dharma has no cognate words in other Indo-European (IE) languages which means that it does not predate the migration of IE languages into India, but is an Indian coinage. This helps us to understand how it was used in RV because it's use is closely related to its it's original meaning of 'foundation'. In particular it is associated with the holding apart of the earth and sky in cosmogonic myths. It is also associated with orderliness - more often expressed in Vedic by the term ṛta - and with the god Varuṇa who oversaw ṛta and was a keeper of the law (cosmic and social though the distinction was not always clear). Varuṇa is sometimes called Dharmapati or Law Lord. In the Śatapatha Brāhmaṇa  the king is equated with Varuṇa. In some of the early (pre-Buddhist) Upaniṣads dharma is what gives the ruler his power - it is the "kṣatrasya kṣatram" or 'ruling power of ruling power'.
Olivelle has counted the number of times the word occurs in the Vedic canon and finds that after 60+ occurrences in the Ṛgveda it is used less in the rest of the canon put together - making it very much a minority term. However the word 'mantra' seldom occurs in the Ṛgveda (only 13 times!) and as Ellison Banks Findly has pointed out "...inattention to a term in the Ṛgveda does not always mean inattention to the corresponding subject". Indeed we find all of the many concepts which 'dharma' later covers - such as order, nature, quality (especially good quality), and law - are all central themes in the Ṛgveda. What we need to explain is how the word dharma came to stand for these other concepts.
Olivelle argues that the adoption of the word dharma is as part of an appropriation of royal symbolism by groups of śramaṇas, who he sees as offshoots of the Brahmins. As I noted in Rethinking Indian History this latter paradigm has recently been challenged and it may suit Olivelle's thesis even better to think of the śramaṇa groups as emerging from a distinct culture and the Brahmins encroaching on their territory as they moved East into Magadha from their heartland north of present-day Delhi. Perhaps they adopted the symbols and language of royalty in order to enhance their prestige in the face of the Brahmin threat to their hegemony? In any case the leaders of śramaṇa groups refer to themselves as 'jina' (conqueror) and 'cakravartin' (wheel-roller - a reference to the wheel of the royal chariot rolling over conquered territory - not to say conquered enemies) . Their teachings are known as śāsana (Pāli sāsana) - the counterpart of a royal edict (from √śās 'to chastise, to command') . Dharma, with it associations of law and lawfulness also partake, according to Olivelle, in this appropriation. While this explains how 'dharma' might have come into use amongst the religious, it doesn't explain the process of accumulation of senses of the word. Since orderliness, adherence to laws and therefore lawfulness, is associated with the king, perhaps this gives us some suggestion about that sense.
According to Tilmann Vetter the earliest Buddhist usage of dharma associated it with other teachers only, and the Buddha encourages his followers not to accept any dharma.  However it appears that if he was not disposed to use the term, he did not hold out very long as dharma soon became central to the Buddha's message. In Buddhist usage dharman (neuter) becomes dharmaḥ (masculine; Pāli dhammo). Technically the masculine form is an action noun meaning 'bearer', but already the scope of what it refers to is considerably broadened. This will be the subject of my next post.
- Vedic was a language with (raised) pitch accents instead of stress accents as we use in English. These are marked with an acute in Roman script. Compare dhárman (neuter verbal noun meaning 'foundation') and dharmán (masculine action noun meaning 'bearer'). Classical Sanskrit uses stress rather than pitch accents.
- Śatapatha Brāhmaṇa is an multi-volume exegetical text which comments on many aspects of the sacrificial ritual. It is related to the Yajurveda, being composed after it but before the time of the Buddha. The last book of the ŚB circulates separately as the Bṛhadāranyaka Upaniṣad.
- A vivid depiction of this kind of warfare can be found in the Mesopotamian galleries of the British Museum which shows 8-7th century BCE Persian kings fighting from two-wheeled chariots. I may be mistaken but it seems to me that there are 4, 6 and 8 spoked wheels on various vehicles: those with 4 appear to be agricultural; 6 for general war chariots; and 8 for the king.
- This argument is based on texts from the Sutta Nipāta which are generally considered to be the earliest layer of the Pāli canon. Vetter argues for even more specificity identifying texts which he considers to in fact be "pre-Buddhist".
- Brereton, Joel. 2004. 'Dhárman in the Ṛgveda.' Journal of Indian Philosophy 32: 449–489.
- Findly, Ellison Banks. 1989. 'Mántra Kaviśatrá: Speech as Performative in the Ṛgveda.' in Alper, Harvey P. Mantra. State University of New York Press. (esp p.15-16)
- Olivelle, Patrick. 2005. Power of Words: The Ascetic Appropriation and the Semantic Evolution of Dharma.' in Language, Texts and Society : Explorations in Ancient Indian Culture and Religion. Firenze University Press.
- Olivelle, Patrick. 2004. 'The Semantic History of Dharma The Middle and Late Vedic Periods." Journal of Indian Philosophy 32: 491–511
- Vetter, Tilmann. 1990. Some Remarks on Older Parts of the Suttanipāta. Earliest Buddhism and Mādhyamika. Panels of the VII World Sanskrit Conference. D. S. Ruegg & L. Schmithausen (eds.). Leiden: E. J. Brill, pp. 36-56.
image: dharma in various scripts: Devanāgarī, dbu can, Ranjana, Sinhala.