why does the score matrix influence the E value (BLAST)
Perhaps this BLAST tutorial by Steve Altschul will be helpful:  The Statistics of Sequence Similarity Scores

There is also the BLAST book by Mark Yandell and Ian Korf.