"To swing the bat" means to make a hitting motion with a baseball bat in order to try to hit the ball.