I want to know the meaning of these two sentences:
Something has been done by it.
or
Something has been done to it.
Are they different in meaning?
The two sentences are different in meaning. I'll add "the cat" to each sentence for clarity.
In "Something has been done by the cat", the cat has carried out an action, like "the cat has scratched me".
In "Something has been done to the cat", something else has carried out an action against the cat, like "I scratched the cat".
These sentences are different, but related. Specifically, they are opposites.
In the first sentence, "it" is the actor, or doer, of some action. In the second, "it" is the recipient, or subject, of the action.
For example purposes, let "something" be "A gift-giving at a party" and "it" be a man (note that "it" is used for non-human beings, and is generally viewed as dehumanizing when applied to human beings).
Then we have:
1) A gift has been given at a party, by the man
2) A gift has been given at a party, to the man
In the first sentence, the man is a giver of the gift. The man had the gift before the party, and did not have the gift after the party.
In the second sentence, the man is the receiver of the gift. The man didn't have the gift before the party, and had the gift after the party.