Why is my boyfriend so attentive to me when his friend is near?

My boyfriend has this female friend who he talks to me about some time. He tells me stuff that she says about me both good and bad usually bad. Whenever she comes around to talk to him, my boyfriend stands really close to me. He's also more sweet to me. She tries to have a conversation with me but he is all of a sudden focused on me.
Why is my boyfriend so attentive to me when his friend is near?
Post Opinion