Game lag....Because of what?

Hello I play starcraft alot and I works just fine with no lag at all. But lets say that I'm on starcraft on my computer then a friend logs on to my internet connection we cant play together. We can both play in different games but not is the same one it creates tons of lag.
I have cable by the way, and what really confuses me is that I went to a friends house and got on his cable with him and we can play together just fine but not at my house! We have the exact same internet!

well maybe it could be your internet connection, maybe your pc is sending back data to low, this happens to me a lot during online gaming, even with a broadband, and when i play ps or xbox too, the connection goes unstable and start to lag a lot.