They're based on your raw HSC marks calculated to one decimal place... this avoids all of the rounding issues introduced with the Board's method of reporting aligned marks.
Your actual aligned HSC mark might have been 96.5, but your friend's might have been 97.4 - and both would have been reported as 97.