When a baby is born, she immediately has a set of reflexes - like rooting for a nipple, crying, grasping, and sleeping. These reflexes are hardwired into the brain and get triggered by certain sensory cues. Hunger and discomfort trigger crying, stroking of the face sets off rooting, and putting something in her hand initiates grasping.
What makes a baby fussy or easy going is coded in the thresholds that trigger the reflexes and shuts them off. Some babies can tolerate a large amount of discomfort before they cry and transition from an active state into sleep quickly. These are easy babies. In fussy babies, the discomfort thresholds may be very low and small perturbations can trigger crying. Most babies are somewhere in between - fussy in some aspects, impervious in others.
The multiple thresholds are set at birth and in essence define the initial personality of a baby. There is probably a genetic component but I bet most are set entirely randomly. After the baby is born, neural plasticity can shift these settings. So depending on how the parents react to the baby, thresholds could be moved up or down.
An entire book industry has sprouted in an attempt to educate parents on how to train their baby to be an easy going one. However, I doubt there will ever be a surefire method. The different sensory and reflex modalities probably interact in a highly nonlinear fashion. So trying to make a baby less sensitive to one thing could make them more sensitive to something else. Personally, I think we should just enjoy our babies the way they are. But then again, I think my baby is pretty easy, even if she stays up all night.