Opposition research is one of the most important aspects of a contentious race.
Wikipedia describes it as:
Opposition research (often referred to as oppo) is a term used to classify and describe efforts of supporters or paid consultants of a political candidate to legally investigate the biographical, legal or criminal, medical, educational, financial, public and private administrative and or voting records of the opposing candidate, as well as prior media coverage.
The research is usually conducted in the time period between announcement of intent to run and the actual election; however political parties maintain long-term databases that can cover several decades. The practice is both a tactical maneuver and a cost-saving measure.