Now, keep in mind that this comma and period inside the quotation marks business is strictly American usage. The British don't do it that way. They are inclined to place commas and periods logically rather than conventionally, depending on whether the punctuation belongs to the quotation or to the sentence that contains the quotation, just as we do with question marks and exclamation points.
And just why, you may ask, do they belong there? Well, it seems to be the result of historical accident. When type was handset (i.e., when the letters where put in place on the printing press by hand), a period or comma outside of quotation marks at the end of a sentence tended to get knocked out of position, so the printers tucked the little devils inside the quotation marks to keep them safe and out of trouble. But apparently only American printers were more attached to convenience than logic, since British printers continued to risk the misalignment of their periods and commas.