The substitution matrices which blast uses to score alignments are based on the probability with which a given amino acid changes to another over large evolutionary distances, so there are different values for each pair of amino acids ( https://arep.med.harvard.edu/seqanal/matrices.html and literature cited therein)
They were derived by statistically analysing large numbers of aligned homologous sequences. For more details, see this book chapter: Chapter Substitution Matrices