With vs. By
Demonstrating
'By' and 'with' as prepositions are used to show how something is done. Have a look:
You can open it with a can opener.
You can open it by a can opener.
Action Agent
We can use 'by' to refer to the agent who has done the action. These agents can be people, animals, situations, or objects. For example:
He was attacked by a cat.
Here, the cat is the agent of the action.
The book was written by an unknown author.
Here, the agent is the unknown author.
Action Tools
'With' is used to refer to a tool that is used to fulfill an action. These tools may be ingredients, body parts, or objects. Have a look:
He was fighting with a broken sword.
Here, 'with' is used to show that the action is fulfilled using a tool which is 'a broken sword.'
The victim was murdered with a sharp knife.
Here, the tool is shown with the help of 'with.'
Action Methods
We can use 'by' and 'with' to talk about what means or methods were used to fulfill an action. Take a look at these examples:
I sent the documents by mail.
You can pay by credit card.
Indicating Companionship
'With' is also used to show two or more people or things are together in the same location. Have a look:
I saw him in town with his girlfriend.
I was with my friends when you called.
Passive Voice
While both 'with' and 'by' are both used with the passive voice but 'by' is more common than 'with.' For example:
The cake was made with no eggs.
The meal was prepared by the man in the white suit.
Comments
(13)Both sentences are grammatically correct and convey similar meanings, but the preposition "with" and "by" have slightly different nuances of meaning.
The sentence "A true friendship is strengthened with loyalty" suggests that loyalty is an essential component that is combined with friendship to make it stronger.
The sentence "A true friendship is strengthened by loyalty" suggests that loyalty is the factor that makes friendship stronger.
In general, the preposition "with" is often used to indicate an accompanying or added element, while the preposition "by" is often used to indicate a cause or means of achieving something. However, in this case, both prepositions can be used interchangeably to convey a similar meaning.
In this example you've written, it is better to use "with" not "by. Because "by" indicates a person or a thing responsible for an action. 'With' is the word used to denote something required to do a specific action.

Recommended
