How does the law of conservation of energy relate to a bat hitting a baseball?
Law of Conservation of energy states that the total energy of an isolated system remains constant or that energy can neither be created nor destroyed, rather, it can only be transformed from one form to another.
This means that in an ideal world where energy is never lost. If I bounced a ball it would keep bouncing without changing or slowing down, nothing because none of its energy would be lost as heat by the friction the ball has with the ground and therefore its momentum would keep it going perpetually. This would also mean that the object is elastic (cannot be deformed) because when you bounce a ball for instance the ball deforms slightly upon impact with the floor then regains its round shape again.
However, in real life this doesn't exist so for your example, if I hit a ball with a bat at first if I'm rotating the bat with some momentum and then when the bat impacts the ball it transfers the energy from you hitting it to the ball which the propels in a projectile/curve (if you're a good baseball player).