A StringBuffer has an array member that it uses to hold the characters, and an int that tells how many of the array positions are actually valid. The rest of the array contains zeroes, or garbage. In general, the size of the array (the capacity) won't be equal to the number of characters in the StringBuffer (the size).
It's quite inefficient to try to keep the array exactly the right size; to do so, StringBuffer would have to allocate a new array every time you called append. By keeping some extra empty space, StringBuffer can only reallocate the array once in a while.