Usually “hin” and “her” are used to describe movement.
Forgive me for copy-pasting the following explanation, but I coudn’t describe it better:
The adverbs hin and her cause much confusion for German learners. There are no direct equivalents of either of these in English and to English speakers they often seem superfluous in a sentence. German in fact signifies directional movement (vs. position) in several ways that English does not. The adverbs hin and her are examples of this specification of movement in a particular direction or from a point of origin.
hin generally indicates movement in a direction away from the speaker object toward a particular destination.
her generally indicates movement from a point of origin in a direction toward the speaker.
Hin and her are used in their most literal sense with verbs of movement (e.g., gehen to go, kommen to come) or activity that involves direction (e.g., sehen to look, geben to give, reichen to hand over). Often they appear as separable prefixes (e.g., herkommen , herholen, hinlegen, hinschreiben). More specific directional adverbs are created through a number of compounds that combine hin and her with prepositions that denote direction (e.g., herauf, herab, heraus, herein, hinauf, hinüber, hindurch, hinzu) or with other adverbs (e.g., hierher, woher, dahin, überallhin).
Note in particular the contrasting examples with the apple. Here, the perspective of the speaker is unclear. Is the speaker in the tree? Under the tree? Beside the tree? But the additional prepositional phrases specify respectively movement from a point of origin (vom Baum), in which case her is used, and movement toward a particular destination (ins Gras), in which case hin is used.
The adverbs hin and her also appear in expressions with extended meanings. They occur for instance in time expressions (e.g., eine Weile hin a while longer still, schon viele Jahre her many years ago). They also appear in a number of fixed idiomatic expressions (e.g., hin und her back and forth, hin und wieder occasionally, hinter dir her behind you [and moving in the same direction as you], auf seinen Rat hin at his advice, von der Erziehung her on account of one’s upbringing). And they occur as verb prefixes with sometimes abstract or figurative meanings (e.g., herstellen to produce, hinrichten to execute).
Finally, in actual everyday usage the lines between hin and her are blurred. While southern German speakers tend to maintain the distinction between the two adverbs, in German spoken north of the Main River her is favored in most situations regardless of direction or perspective, and this is commonly reduced to ‘r (herüber > ‘rüber, hinaus > heraus > ‘raus).
No wonder hin and her cause confusion for learners! Apart from being aware that these variations exist, the basic guidelines of movement toward a destination (hin) and movement from a point of origin (her) can at least provide a useful point of reference.
Not each word that contains “hin” or “her” refers to some kind of destination/movement. So the “hin” doesn’t always add the same specific meaning. Examples: ohnehin (anyway), immerhin (at least), etc. Or as mentioned in the text herstellen (to produce), etc.
I’m sorry, I know that’s probably not what you were hoping for, but that’s the way it is. ;)