The Welsh word tref literally means town and is used in
that sense in modern Welsh.
However in a historical context, tref would be more properly
understood to refer to a village, and therefore analagous to the English parish or township. Each tref would belong to, and be governed by a specific cwmwd or commote.
Frequently abbreviated to Tre when compounded to create place names such as Trebannws or Tregaron. A similar pattern exists in other Brythonic Celtic languages, namely Cornish and Breton, in which Tre has the same meaning. So that you find a similar pattern of Tre-something place names throughout both Cornwall and Britanny.