What did their baptism by John accomplish? Undoubtedly, it helped prepare them for conversion, for he preached repentance. And it likely strengthened their resolve to obey God. But the baptism didn't bring about their conversion or result in their receiving the Holy Spirit. Clearly, many factors have to be in order for that to take place, including knowledge of sin (the transgression of God's law, 1 John 3:4 1 John 3:4Whoever commits sin transgresses also the law: for sin is the transgression of the law.
American King James Version×), an awareness of the need for forgiveness, true repentance (turning from sin to obedience), faith toward God and Christ and a clear understanding of the obligations of Christianity. In addition, the baptism should, under normal circumstances, be done by a minister of God's Church, followed by the laying on of hands and prayer to receive the gift of the Holy Spirit.
You can read this encounter in Acts 19:1-6 Acts 19:1-6  And it came to pass, that, while Apollos was at Corinth, Paul having passed through the upper coasts came to Ephesus: and finding certain disciples,
 He said to them, Have you received the Holy Ghost since you believed? And they said to him, We have not so much as heard whether there be any Holy Ghost.
 And he said to them, To what then were you baptized? And they said, To John's baptism.
 Then said Paul, John truly baptized with the baptism of repentance, saying to the people, that they should believe on him which should come after him, that is, on Christ Jesus.
 When they heard this, they were baptized in the name of the Lord Jesus.
 And when Paul had laid his hands on them, the Holy Ghost came on them; and they spoke with tongues, and prophesied.
American King James Version×, where you will see that Paul—after counseling the believers—baptized them again and laid hands on them.
Like baptism, the practice of laying on of hands has its historical roots in the Old Testament. In ancient times this practice, often accompanied by anointing with oil, was used to set men apart to serve God in the offices of king or priest. It was also sometimes invoked in setting apart sacrifices or other things for holy use. Similarly, laying on of hands after baptism signifies that the newly baptized person has now been set apart for God.
Since the days of the apostles, the laying on of hands after baptism has signified the actual moment of the receiving of the Holy Spirit and the setting apart of a convert as a child of God. It is only through the gift of God's Spirit that we can develop the godly attitude of obedience and faith. The practice of laying on of hands for the receiving of God's Spirit is mentioned in Acts 8:17 Acts 8:17Then laid they their hands on them, and they received the Holy Ghost.
American King James Version×; 19:6; and 2 Timothy 1:6 2 Timothy 1:6Why I put you in remembrance that you stir up the gift of God, which is in you by the putting on of my hands.
American King James Version×.