The minhag to swing "kaporos” before Yom Kippur is an ancient and accepted custom among most of the communities of Klal Yisroel. Although the Shulchan Aruch opposed this custom, the Rema encouraged it, writing: "Some Gaonim and many Acharonim cited this custom. It is practiced in all countries, and it should not be abandoned, since it is the custom of the pious." )שולחן ערוך" או"ח סי' תר"ה"(
The earliest known source for this minhag is from Rashi from Shabbos 81b. The Gemara discusses a potted plant called parpisa. To define this term, Rashi )"ד"ה "האי פרפיסא"( writes that he found in the Teshuvos of the Gaonim that the custom in the time of the Talmud was to make wicker baskets and fill them with earth and fertilizer, one basket for each member of the household. The baskets were called parpisa. Twenty-two or fifteen days before Rosh Hashanah, grains or legumes were planted in the baskets, and by the time Rosh Hashanah arrived, they had already sprouted. The day before Rosh Hashanah, each person would take his basket, and circle it around his head, reciting, “This is in place of that; this is my exchange, this is my substitute," and then throw the basket in the river.
What was the significance of this custom? The Chasam Sofer )שם( explains that the seeds sewn in the parpisa baskets corresponded to a person's children. They prayed that if a Heavenly decree had been passed against their seed, may fall it upon the parpisa seeds, and not upon their children. This concern was especially prevalent in the time of the Gemara, when a epidemic of ascara, a fatal breathing disorder, claimed the lives of many children. They cast the parpisa plants into the river, since when Beis Din is unable to carry out the punishment of death by strangulation, HaShem brings about the guilty party's death by drowning or ascara. They thus prayed that the “drowning” of the plant, take the place of the ascara that might afflict their children, G-d forbid.
Kaporos with a chicken:
Many years later, the custom changed, and people instead performed kaporos with chickens. The Rosh )יומא פ"ח סי' כ"ג( cites this custom, and asks why specifically a chicken is used, and not a different animal. Most simply, he explained that chickens were the most common animals to be found among the impoverished Jewish communities of Europe. In more affluent communities, horned animals were used, in order to recall the merit of the horned ram that was sacrificed in place of Yitzchak Avinu.
Another reason why a chicken was used, is because the Hebrew word for rooster is gever, just like the Hebrew word for man. Therefore, it is the most appropriate substitute for man.
The Acharonim write that one must never use an animal that would be kosher as a sacrifice on the mizbei'ach (such as a dove, sheep, goat or cow), in order to avoid the mistaken impression that one intends to sanctify the animal as a korban. ("משנה ברורה" שם ס"ק ד')
Today, the minhag of kaporos is prevalent among both Ashkenazic and Sefardic communities. Although Sefardim generally follow the rulings of the Shulchan Aruch, who opposed the custom of kaporos, in this case they follow the Rema, since the Arizal also attached great importance to kaporos )'כף החיים" סי' תר"ה ס"ק ה"(.
Interestingly, R' Yaakov Emden zt'l )שערי שמים" קי"ב ע"א"( writes that even today, if one does not have chickens or money with which to perform kaporos, he should follow the custom of parpisa, and perform kaporos with seeds.