Tamil's origins are independent of Sanskrit (which is from the Indo-European language family and the ancestor of many Indian languages), but it has borrowed a number of words from Sanskrit in recent centuries. The oldest Tamil text Tolkaappiyam is a grammar of Tamil.
Quite significantly for its age, Tamil seems to have undergone minimal changes and adaptations over the years. Classical Tamil is quite comprehensible to speakers of the modern language. The ancient Tamil book Tirukkural is an example. The verses from the book are often taught to young students of the language at the primary level, and they pick up the lines in the ancient dialect with little difficulty.