This question already has an answer here:
I have always had a hard time understanding the English Grammar rule that punctuation end marks like periods, question marks, or exclamation marks should be placed before the end quote.
For instance, why is this correct:
Alice said, "I'm going to go buy another cat, my thirtieth."
But this is not correct:
Alice said, "I'm going to go buy another cat, my thirtieth".
While this question may have been answered in terms of correct usage, I am looking for the reasoning behind the usage, not how to use it correctly.