The group number designates the physical size of the battery. In this case groups 27, 29, and group 31 batteries are fairly close in size.
Here are the dimensions for the batteries being discussed according to BCI (Battery Council International)
BCI Battery Group Size Chart
Group 31: height 9 7/16" length 13" width 6 13/16"
Group 29: height 8 15/16" Length 13" Width 5 1/2"
Group 27: height 8 15/16" length 12 1/16" width 6 13/16"
Keep in mind all battery manufacturers do not necessarily follow the dimensions layed out by BCI. I have seen several batteries labeled as Group 27 with dimensions that vary up to 1/2" from the standard.
Also there is a range in the amp hour output because all batteries are not created equal. They all may have the same number of plates per cell, but there can be a difference in the physical size of the plates. Generally speaking the larger the plates the larger the output, and the heavier the battery.