"sheets of cotton fiber," 1875, variant of obsolete bat "felted mass of fur, wool, etc." (see bat (n.1)), on notion of "beaten" fabric.
"action of striking with a bat," 1610s, verbal noun from bat (v.2). In cricket, from 1773. Baseball batting average is from 1867.