At the moment the bat touches the ball, energy from the moving bat is transferred to the ball, setting it in motion.