When the person who did the action is unknown
When the person who did the action is COMPLETELY unknown, then we usually don’t include “by ______.”
For example, “The bank was robbed.” We don’t need to say “The bank was robbed by someone” or “The bank was robbed by robbers” because this is not adding any useful information to the sentence.
Now, if we have some information, we can include it: “The bank was robbed by five middle-aged white men” – in this case, we are adding some information about the suspects because we’re trying to identify them, even though we don’t know their names yet.
When the person who did the action is known
The second case is when we DO know who did the action. In this case, the answer about whether or not to include “by ________” is that it depends.
If it’s important to mention the person who did the action, then we include “by _______” – but if the person who did the action is not important, then don’t include it.
Here’s an example – if you’re going on a tour of India, and you’re looking at the Taj Mahal, the tour guide might say:
“The Taj Mahal was built by the emperor Shah Jahan in memory of his wife.”
…because this is interesting information about the origin of the monument.
But if you’re touring New York City, and you’re looking at the Empire State Building, the tour guide might say:
“The Empire State Building was built in 1929.”
…but they probably wouldn’t add, “…by a construction company” because this detail is not very interesting or important.
So when the person who does the action is known, whether or not to include “by __________” simply depends on how important or interesting that fact is, in your opinion.