As you project, you are kind of hurling the pain at someone else. Whatever the issue is, let's say you are angry at someone for how they treated you or that they acted a certain way that was hurtful. As this hurt comes up in your mind, it will find a target and project toward it. It actually tries to turn that person INTO the person that you are upset about, and you start interpreting their actions as though they're doing exactly what that person did.
And as you do this projecting, it's kind of like you are judging, condemning and attacking the person with this stuff. You're trying to turn them into this stuff, to fill the role. And for most people this actually influences them and may cause them to start acting in a way that fits the 'role' that you are projecting. And this makes it even more plausible that all of this upset is because of them.
In the midst of such hallucinations you can really get to believing that this person is doing this to you, and at the same time you are feeling the old hurt, and putting two and two together you think its because of them. But what's really happening is the person is just triggering your old hurt and you're not really dealing with it.
Whatever the person seems to be doing, it likely is similar to what someone else did in your past. Form-wise it may not be similar at all. It could be that the person has the same attitude, or reminds you of how someone was a certain way when around you, even though their physical behavior and appearance may be different. The psychological 'content' seems to match and this creates a connection.
In this state of semi-consciousness it's pretty hard to realize that this is what is going on, especially when you're convinced it's all to do with this other person. But what you're feeling is your own stuff, for which you are responsible, and this projection is just hurting the other person. You are accusing them of what you believe someone else did to you so that you have a way to scapegoat the energy and seem to get it out of your mind. Which doesn't work.
The only way is to realize that you are triggered, you are reacting, you are re-experiencing old stuff, it's nothing to do with anyone else, and you need to own it and heal it. Taking the burden off the shoulders of the other person is a good start.