Giles was arrest after being held in contempt of court for refusing to revel the name of his informant to the court. Giles deposition is an attempt to prove that Putnam wants Jacob’s to hang so he will forfeit his property. Danforth refuses to hear the evidence unless Giles reveals the name of the person.
Mary Warren is in court because Proctor needs her to tell the court the truth and free his wife. Danforth is suspicious because this is the first he's heard of this and he doesn't believe everyone could have lied. Mary tells Danforth that she was lying and that all of the girls are lying. Danforth is suspicious of Mary and Proctor because he thinks Proctor is threatening Mary into this confession.
Parris invalidates them by calling Proctor a bad Christian and telling the court how he doesn't go to church and even works on Sunday, Sabbath day. Giles deposition is turned against him when he is unwilling to betray anyone else.
The purpose of the court is justice and rid Salem of the Devil and sin. The government is a theocracy, therefore God is the only true witness. This is wrong because anyone can accuse any person of witchcraft whether they witnesses it or not.