According to the epic poem La Araucana, the colors were derived from those from the flag flown by the Mapuche during the Arauco War. “Flag Day” is held each year on the ninth of July to commemorate the 77 soldiers who died in the 1882 Battle of La Concepción.
A detailed discussion of previous flags associated with Chile can be found elsewhere.