It's been years since I've seen this play, but Agnes is a very young nun who is discovered bleeding outside her room at the convent. Upon further examination, a newborn child is found in the wastebasket of Agnes' room. The baby is presumed to be strangled. So, the "how" is easy.
The "why" is more difficult. Being that Agnes is a nun, and nuns are not supposed to be physcially intimate with men, that would be a good reason for discarding the child. However, Agnes is also very mentally fragile. She tells everyone that she has no knowledge of not only birthing and killing the child, but also no knowledge of conceiving the child. In this most innocent way, she almost seems very much like Mary in Bible who is a virgin pregnant with the Lord's child. It is not until Agnes is put under hypnosis that some semblance of the truth comes out--the gardener is supposed to be the father. Now, as to the murderer of the child? It may be Agnes, it may be some other nun in the convent. Whoever it was, the reason remains unclear as well. Perhaps the child was killed to hide Agnes' pregnancy. It may be to protect the reputation of the nuns in the convent. It may be to get revenge on the man who fathered the child.
This is a fascinating play with many subtle layers of meaning. I hope you will go back and re-read parts of it to determine your own beliefs as to the "why" the baby was killed.