This difference in practice goes back to the early days of Protestant Reformation. The tradition up to then had been to baptize at any age, including infancy. In view of high infant mortality, the earlier the better, many believed.
The emerging Baptist tradition, however, argued that the sacrament of initiation into Christian community needed to be a conscious decision made at an age of maturity, much like the Bar Mitzvah of Judaism. For that reason, they delayed baptism until around the age of 12. At the same time, they wanted to affirm a newborn baby and to engage the congregation in caring for that child. Hence, the ritual of dedication.
Some reformation churches, such as the Episcopal, Methodist, Lutheran and Presbyterian churches, continue to practice infant baptism, although it isn't required and the decision isn't accompanied by any medieval superstition about an unbaptized child's going to hell if they die young. Some conservative churches have adopted the Baptist tradition, known as “believer's baptism.”
As with every other argument in Christianity, each side has plenty of Scripture and Tradition to support its views.