In general, a militia is the entire able-bodied population of a nation that can be called upon to defend itself against an enemy. It is distinguished from the organized military forces of that nation. It can serve to supplement the regular military as an irregular reserve, or it can oppose it, for example to resist a military coup.
For much of the history of England, the military was controlled by Parliament, which had access to the resources to maintain a standing army. At various times, the Crown and Parliament were in strong disagreement, but Parliament's economic ability to use the army was counterbalanced by the Crown's traditional ability to call out the militia. As long as the army's weapons were not radically more powerful than the militia's, this balance of power was effective.
The Framers of the United States were certainly aware of this tradition, and gave Congress the power to "provide for organizing, arming, and disciplining the Militia," as well as, and in distinction to, the power to raise an army and a navy. The Second Amendment to the Constitution of the United States may have been intended to formalize this balance between the "well-regulated" militia and organized military forces. Considerable controversy exists in the US over this amendment, however, and the ability of even a well-regulated militia to resist a modern army is debatable.
The United States Consolidated Statutes Title 10 (Armed forces), section 311 (Militia: Composition and Classes), paragraph (a) states "The militia of the United States consists of all able-bodied males at least 17 years of age and, except as provided in section 313 of title 32, under 45 years of age who are, or who have made a declaration of intention to become, citizens of the United States and of female citizens of the United States who are members of the National Guard."
- (please add info about non-USian militia!)