Function 1: the destination of action
I was back to the motherland.
“motherland” is the destination of action（be back）
Function 2: the object of action
I write letters to friends.
“friends” is the object of the action “write letters”.
①Both へ and に has the function of telling us the destination of action，but it sounds more natural to use へ.
②Both へ and に has the function of telling us the object of action，but へ emphasizes the process of action，while に emphasizes the result of action.