Because gentle jiggling/rocking tends to calm babies. Mine, anyway. Sometimes, gentle jiggling doesn't work, so you do it a bit more. Nothing much, just kinda a joggle with the knees, but the increased frequency/amplitude works better sometimes. Add the factors explained above, and sometimes you end up shaking that kid for all he's worth.
I kind of wonder, though—if there is an impulse built into humans to take out their anger on their children, killing the children in the process, should not we have evolved as a species to either have a stronger maternal instinct to prevent this behavior, tougher children, or children less prone to being annoying?