Arachne, in Greco-Roman mythology, was a young woman gifted in the art of weaving who proclamed that Athena herself could not do better than her.
Athena was quite perturbed at Arachne's claim, but she decided to give the young woman a chance to redeem herself. She came to Arachne disguised as an old woman and warned her to be careful not to offend the gods, but Arachne told the old woman to save her breath. She welcomed a contest with Athena, and, if she lost, would suffer whatever punishment the goddess deemed necessary. The goddess accepted the challenge and revealed her true form.
Arachne, for her part, created a tapestry showcasing scenes of Zeus various infidelities: Leda with the Swan, Europa with the bull, Dana and the golden rain shower. So exquisite was the mortal's work that the bull seemed lifelike, swimming across the tapestry with a real girl on his shoulders. Even Athena herself was forced to admit that Arachne's work was flawless. (Whether or not Arachne was actually better than Athena is still a mystery.)
Angered at Arachne's challenge, as well as the presumptuousness of her choice of subjects, Athena tore the tapestry to pieces and destroyed the loom. Then she touched Arachne's forehead, making sure that she felt full guilt for her actions. Arachne was ashamed, but the guilt was far too deep for her poor, mortal mind. Depressed, she hanged herself.
Athena took pity on Arachne. She most likely did not expect that Arachne would commit suicide. She brought her back to life and transformed the woman into a spider, her and her descendants.