If you set autobarcode to "generated in the form 1,2,3," Koha will find the largest numeric barcode in your system and add 1. However, if your largest numeric barcode has leading zeros, those will not be maintained in your new item. So if the current highest barcode is "09000," the next barcode generated will be "9001." Apparently we fixed this on bug 5681 way back in 2011, but it has since regressed.
*** This bug has been marked as a duplicate of bug 27426 ***