Taking a photo of a moving subject can often be difficult if your camera suffers from shutter lag. Your subject appears to be in the perfect position for the shot, but when you take it they have moved from it slightly. This is basically because the camera isn’t taking the photo the instant you press the shutter and most digital cameras actually have this problem.
The digital camera has an image-recording chip which more or less constantly produces a moving video. You can see this through the screen or viewfinder and the frame is frozen when the shutter is pressed. Capturing an image takes quite a bit of processing which can also take a bit of time. But the newer the digital camera is then usually the less shutter lag there is due to the improvements in technology over the years.