The main activity of a farmer is growing crops and selling them. For this he has to sow the seeds, cut the crops, process them, take them to the market etc. All these form a part of the primary activity of the farmer.
Along with this he also has to do things like, building fences, keeping birds away etc. These activities do not have a direct nexus with his main activity but he still has to perform them. Merely by building fences the crops won’t grow but building fences ensures their safety.