Why did they begin to do it and what materials did they use?
For most of history it was your left hand, hence why in most cultures you don't touch anyone's left hand: it was the unclean hand. Linens and hemp were used in various cultures and washed and reused, but this is mostly for the rich. Commoners would typically go in the local river (didn't know any better) and would wipe with pretty much anything: grass, leaves, rags, etc. The Chinese were the first to use paper, and various travelers (European and Middle-Eastern) were kind of disgusted by this, since paper was to be used for wisdom and learning after all.
Toilet paper as we know it was introduced in the United States in the 1850s, but did not become widespread until later. Indeed, the idea of using any paper was uncommonly popular in the US, and for a very very long time the Sears catalog was famously used by poorer people as toilet paper. From there, it grew to popularity that we know today.