To the OP, I knew absolutely zilch, nil, nada about babies when I was pregnant with my daughter. I wasn't even maternal at all. I was worried all the way through the pregnancy that I wouldn't know what to do with the baby, and wouldn't bond with it.
It just comes totally naturally when the baby is born though. You just KNOW how to change its nappy (it's not difficult!) and you just know that when it cries it can only be one of a few things, so you try out a couple of things and if it doesn't stop the crying then you try something else.
Instinct very much takes over. That and common sense.