Tarberries are a required component of Berry Mentats, which give a substantial +5 boost to Intelligence, and thus earned experience. Under normal circumstances, this works out to about a 16.666% bonus. This is likely the reason that tarberries are one of the rarer crops in the Commonwealth.
Tarberries can only be farmed at the Slog. A swimming pool containing nine farmed tarberry plants, which can normally be harvested once a day. The player character is not required to have the Slog as a settlement to harvest the berries, but the settlers must be alive. Additionally if one does control the settlement, settlers must be assigned to farm them like typical crops.
Most companions will comment on the ingenuity of farming tarberry in a former swimming pool, alluding to the general Commonwealth knowledge that tarberries are rare and difficult to cultivate commercially. The ghouls at the Slog say that they have the best tarberries in the Commonwealth, but truthfully, they have the only cultivated tarberries in the Commonwealth.
Tarberries cannot be planted, and can only be found growing in ponds, swimming pools, and on any surface of still water. General goods vendors (i.e. Myrna and Trashcan Carla) occasionally carry 1-3 tarberries for sale.
Locations notable for quantities of renewable tarberries:
The following is based on unverified behind the scenes information and has not been confirmed by canon sources.
Massachusetts is known for its cranberry bogs at Cape Cod, southwest of Boston. The tarberry is riff on that, as cranberries only grow in water and are similar in shape and size to the tarberry image. Also, the fact that they only grow in water would explain why they can't be planted elsewhere.
End of information based on unverified behind the scenes information.