Kind and sort (and variety, and type, etc.) are names for groupings (typically of noun phrases),
according to some shared criterion.
- It's the most common/expensive kind/sort/type/variety/model of positronic brain defibrillator.
Etymologically, kind is a noun from the Proto-Indo-European root *gen- 'give birth to, be born, offspring', along with words like king, kin, gonad, and gentle, while sort is a verb from sors, sortis- ‘lot, condition.’ It refers to the common activity of sorting objects (and by extension, events) and features in many idioms and phrasal verbs.
From a kind/sort of cookie to kind/sort of a cookie is not much of a jump in meaning, but the grammar is different for kind and type, and for them alone. Sort and kind have each developed quantifier-like idiomatic extensions with of (sort of and kind of), both meaning 'close to; approximately'. And these constructions can modify anything at all, even verbs. These are both so common that they have their own eye-dialect spelling contractions -- sorta and kinda.
- She got sort of mad ~ She sort of got mad ~ She got sorta mad ~ She sorta got mad.
- She got kind of mad ~ She kind of got mad ~ She got kinda mad ~ She kinda got mad.
Naturally, when you're dealing with classifiers and other operators, it matters where you put them. In the sentences above, kinda and sorta can go before mad, meaning 'somewhat mad', or they can go before got mad, meaning 'did something that was close to getting mad'. These may in fact refer to precisely the same behavior, depending on the speaker's judgement about others' emotions.
This extension, by the way, doesn't happen with type, model, or variety:
- It's a type of cookie, but *It's type of a cookie ~ *She got type of mad ~ *She type of got mad.
So in this regard, kind and sort are synonymous.