Dr. Gero sent out small mechanical bugs over the years to observe the Z Fighters and gather data on them, so that Dr. Gero could make his Androids strong enough to defeat them by processing this data into power. Android 17 and 18 were responsible for killing almost all of the Z Fighters and turning the Earth into chaos, leading Trunks to travel back in time (to our present day) and warn about the Android so preparations could be made for their arrival.
But time was altered from Trunks’ visit, and the present day Earth was eventually attacked by Androids 16, 17, 18, 19 and 20 (and also Androids 13, 14 and 15 in the 7th DBZ Movie). Android 17 and 18 are in fact cyborgs who were originally human, but giving mechanical enhancements by Dr. Gero. The doctor’s final creation was Cell, a “living Android” who needed to absorb Androids 17 and 18 into it’s being in order to transform into the ultimate and “perfect” being...
Androids is the general english term used for this saga and all of the villains, but they are also referred to as "Artificial Humans". Either term is not quite correct however, as 17, 18, and Dr. Gero are all cyborgs, which are humans with mechanical enchancements/replacements. The term android typically refers to 100% mechanical, which would be the cases for Androids 19 and 16, as they were 100% mechanical beings.