Something becomes prayer when it is specifically directed to God, either directly or through a saint, rather than, for example, being directed to a fellow human being, or something one says/thinks entirely to oneself.
Something becomes prayer to a particular saint when it’s particularly directed AT that saint and not, for example, directly to God or to an entirely different saint.
Prayer is basically a conversation or communication, directed to or with God or a saint, and it’s made so by our intending it to be so.
In this it is similar to our conversations with other humans. Let’s say I talk to a friend on the telephone - obviously that’s a conversation with my friend, because my intent was to dial his or her number and talk to him or her and no-one else.
Let’s then assume that my little brother overhears this telephone conversation. It remains a conversation with my friend alone, because I didn’t intend it to be a conversation with my brother as well. Even if I know he’s overheard, because I didn’t INTEND what I said to be for his hearing it’s still NOT a conversation with my brother.
If, however, I INTEND him to also be involved - for example I say to my friend ‘wait, my brother’s here, I’ll ask him if he also wants to come to that party you mentioned’ or something, then it becomes a conversation with my brother as well.