I think most of us can think back on our childhood and remember an imaginary friend. If you can't remember, ask your parent(s) and see if they remember you having a special friend no one else could see. A baby is brand new to physical life, but his or her spirit is not brand new. Babies and young children are still connected to the spiritual plane, therefore it is easier for them to see spirits.
As a child I remember I had two spirits. One was an adult and I also had a dog. I don't remember much more than that, but I remember having a lot of fun with them. Over the years, children naturally become more connected to their physical life and eventually loose the ability to see and interact with spirits. A very few will continue to see spirits. These people are called "mediums". For awhile, I ignored the spirits, though I continued to see them. They became scary to me so I just wanted them to go away. As an adult, I learned not to be afraid and how to control my ability.
When my daughter was a toddler our home was heated with oil space heaters. One day she told us that there was a little girl, and she told her never to take daddy's medicine because it could make her sick. We took this to mean the little girl had died by playing with her parents medicine. My daughter also said she was warned to watch the oil heater because it could make a fire. Upon checking the heater we realized it was too close to the curtain and had burned the fabric. We are very thankful for that spirits warning.
So to recap, imaginary friends help our children through their first years of life. They may or may not loose the ability to see and speak with spirits. As parents, I think we can learn a lot about our children by talking about what they do with their imaginary friends. Who knows, perhaps you'll be able to avoid a disaster like my daughters friend helped to do.
Blessings, Love, and Light