In the Middle Ages, as now, Christian children were generally baptized. But this was not originally the case. Baptism is in the New Testament. John, called "the Baptist" (well, we could have guessed that), baptized Jesus with water from the river Jordan, in essence anointing him and declaring him the Christos, the Messiah, the anointed one. Early Christians got to be baptized too, as a marker of being Christians, though they didn't get to be the Messiah.
Originally you had to be an adult to be baptized, to know what you were doing and choose deliberately to be Christian. Early churches had big baptismal fonts, about the size of a 55-gallon drum, in which to dunk people. Originally a bishop's church, the cathedral, would have a baptistry next to it, a church dedicated (no surprise) to Saint John. However, once the original cathedrals started being rebuilt and expanded (eighth-ninth centuries), they generally incorporated the baptistry. (The doorway below is from the ninth century.)
Because baptism was supposed to wash away "original sin" (the sin that has been with humans since our origins with Adam and Eve), many people put off baptism, to make sure that they had most of their sinning out of the way first. It was grueling to atone for serious sins after baptism. Constantine, the fourth-century emperor who was the first to tolerate Christianity in the Roman Empire, was also the first to be baptized, but he waited until he was dying.
The problem with waiting was that it became generally accepted by the fifth century that if you didn't have original sin washed away by baptism, you were going to hell. Saint Augustine famously said that the floor of hell was paved with the souls of unbaptized children. Parents, understandably worried, started baptizing their children at birth. Because the only place to be baptized before the twelfth century was the cathedral, a big trip to town would be required. Infants of course were not in a position to adopt Christianity, as they were not old enough to know what they were doing, so they had god-parents, adults who acted as proxy and who promised to teach them the religion they had (theoretically) accepted. God-parents would also often choose names for the children.
Because baptism now only washed away original sin, not the normal sins of life, rituals had to be developed and become standard for confession, atonement, and especially for last rites, a final chance to get rid of one's burden of sin before it was too late.
During the Reformation era (sixteenth-seventeenth centuries), some Protestants looked at the history of Christianity and decided to return to adult baptism. They were labeled "Anabaptists," meaning those baptized twice, though of course they were only baptized once, as adults. Both Protestants and Catholics declared them heretics. Because they also took very seriously all the parts of the New Testament that talked about non-violence, both Protestants and Catholics had even more reason to hate them during Europe's religious wars. ("How can you be a pacifist? Don't you know there's a war on?") It's not surprising that the Anabaptists, most notably the Mennonites and the Amish, came to the US as soon as they could, to try to escape the persecution—for example, the Amish were probably the first white settlers in Ohio.