While it's a commonly used phrase, it's actually a proverb because it offers a piece of advice or a general observation about life. It literally means "a retaliation for a previous action."
Idioms, on the other hand, are phrases where the meaning is not literal, and often can't be understood by simply looking at the individual words. For example, "kick the bucket" means "to die."
Therefore, while "tit for tat" is a common expression, it doesn't meet the criteria of an idiom.