An action (something a person does) is done "to" them, "by" somebody.
In active voice, the 'doer' is the subject:
John hit Bob - the action was done by John, to Bob
In the passive voice, the receiver of the action is placed first, in the subject:
Bob was hit by John.
the function of 'by', therefore, is to show who the "doer' of the action is;
just as 'to' tells us who or what was was on the receiving end of the action, to whom it was done
"the tree was climbed by me" is correct grammar.
I'm not sure what you are asking in (3)
Student or Learner