Transferred intent is a criminal action that is created when someone intends to hurt another person but ends up hurting a different person instead. The person that is hurt is able to file charges against the person who assaulted them even though it was not that person's intent to assault them.
When a person intends to break the law and harm someone else, they are held legally responsible for everyone that gets hurt along the way.
The intent of the person who caused the action is transferred to the person who was actually harmed in the same way as it would be if the person they intended to harm was the one who was subjected to the crime.
In many cases, a crime can be directed at one person, but end up hurting others as well. An example of this is a drive-by shooting in which an intended victim is shot but bystanders were also shot in the process.