Confetti was once something you could eat, and later something that left a mark.
The word is the Italian plural of confetto, a sweetmeat. Etymonline traces it to Latin confectum, "prepared." Merriam-Webster adds that this is the past participle of conficere, "to prepare," a root shared with English confection and comfit. Atlas Obscura adds that the Italian name comes from confettare, "to sugar coat."
Those sweets were sugared nuts and fruit. By the 14th century, in Boccaccio's Decameron, the confection had its current name. Sugar was costly, so Atlas Obscura says production stayed limited until the late 1700s.
Italian carnivals turned them into ammunition. In Goethe's 1788 account of the Roman carnival, revelers saved the expensive almonds as a last resort. They threw cheaper substitutes such as chalk or plaster balls, or sugar-coated grains. Dickens, in 1846, stocked his carriage with candy and wore a protective face mask.
That is the surprise. When English first records confetti, in 1815, Etymonline says it means "small pellets made of lime or soft plaster" thrown by Italian revelers. The lime balls left white marks on clothing.
Etymonline quotes John Bramsen's Letters of a Prussian Traveller (1818). Roman ladies tossed confetti at admirers, and a fashionable beau showed his popularity by having his coat and hat covered in it.
An 1828 guide, Abraham Eldon's The Continental Traveller's Oracle, says the confetti were originally sugar. Etymonline reports that lime balls later replaced them and made the game livelier.
Paper came last. Etymonline says that by 1846 the word meant bits of paper tossed at weddings and other occasions, a custom England adopted in the early 19th century.
In Italy, Atlas Obscura says the switch to paper came shortly after 1875. Enrico Mangili realized he could sell the machine-cut paper circles left over from making silkworm bedding. Italians call paper confetti coriandoli, after coriander seeds once used as a cheap stand-in.
So the paper at a wedding is the third thing to carry the name, after candy and plaster.