Why was the baseball bat invented?

It was invented so that when playing baseball the players could hit the baseball with something to score runs.