Points,miles & ranking

I don't understand the ranking system. Myself and my team have more miles than other teams with the same amount of points and fewer miles rank higher. can you explain please?