The Mapuche were a bellic culture, and their history was plagued by wars and conflicts since they began to settle in the Araucanía; they believed that history was created through warfare, and thus engaged in many military conflicts.

Military culture and organization
Among the Mapuche, war among themselves was conducted by one lof under its lonko against another, or by an alliance of rehue or aillarehue under a toqui, for the purpose of avenging a real or sorcerous injury, (if restititution was not forthcoming) or for acquiring women and plunder.

Leadership
However, by the time of the arrival of the Inca and later the Spanish, the Mapuche had begun call Butalmapu (assemblies) of their leaders to elect a Toqui to provide a unified command for their armies.

In case of such an invasion, or later revolts or wars against the Spanish the instigating Mapuche Ulmen would call a Butalmapu by "sending around the Pulquitin".   This special pulquitin (arrow) was an arrow stained with the blood of llama's heart with knotted red threads indicating the place and date of the Butanmapu to decide whether to go to war and if so what the plan of campaign would be.  Sometimes the heads of slain enemies would be sent to these other clans as incentive or gifts to inspire them to join this alliance.

The Toqui was chosen in a Butalmapu, of the Lonkos (chiefs) of various Lofs (clans), or Aillarehues (confederations of clans), allied during the war in question.  The toqui had the power to enforce obedience of the troops, organize them, and appoint leaders to them.  The command position would continue until the war in question ended, or if in an assembly the Lonkos decided the toqui to be incompetent.  In the event of death, a new toqui would be appointed.

The Mapuche were already well organized, upon the arrival of the Spanish colonists.  In the previous century they had fought against the expanding Inca Empire and had stopped their invasion at the Battle of the Maule.  They could in case of invasion, summon large, organized bodies of warriors and from at least the time of Lautaro’s revolt were able to build forts and complex defensive works to defend themselves from the invaders.

Tactics
After the initial Spanish conquest, beginning with Lautaro, the new toquis included many new tactics in order to fight the invaders.  Lautaro had been captured in one of Pedro Valdivia's earliest campaigns in Araucania and as a page to Valdivia learned of the strengths and weaknesses of the Spanish especially their cavalry.  After escaping and becoming a leader of the revolt against the Spanish, Lautaro was instrumental in teaching Mapuche warriors, (previously accustomed to infantry battles in the open field), guerrilla tactics and the use of terrain to reduce the effectiveness of the Spanish cavalry.  He also was using espionage carried out by the supposedly conquered Mapuche to be informed of the actions of his enemies.  He also built and used fortresses as bases during his invasion of Spanish territory in central Chile.

By 1553 the Mapuche began to have cavalry of their own thanks to Lautaro and his betrayal of the Spanish, that soon were capable of defeating the Spanish cavalry. By the 1560s  the Mapuche began to use camouflaged pits and trenches, captured artillery and firearms.  By 1570 they had learned the use of infantry formations, similar to the Spanish Tercio, that allowed them to defeat Spanish cavalry in the open field.   After 1600, they mounted their infantry on horses for greater mobility and developed the tactic of the malón.  By the 1620s it was usual practice in battle for two thirds of their force to fight mounted as lancers on the wings with foot in the center, similar to the Spanish custom.  When retreating from a malón the Mapuche would often tempt their pursuers into a narrow defile where their main body would confront them.  If the pursuers fell on this body ambush detachments would fall on their flanks.  All these advances proved effective in holding off the Spaniards and Chileans for 350 years.

References

Sources
 Eduardo A. Cruz Farias, An overview of the Mapuche and Aztec military response to the Spanish conquest, La Guirnalda Polar, Núm. 150 - Textos marcados y recordando a Víctor Jara, Publicación de mayo, 2009.
 Giovanni Ignazio Molina, The geographical, natural, and civil history of Chili, Volume 2, Chapter III, pp.68-77, Military System of the Araucanians; their Arms and Mode of making War.

Mapuche history
Military history of Chile
Military history of Argentina