this is why you are my friend = 이게 니가 내 친구인 거야
actaully, that whole sentence is a abbreviation
so origial basic fromal sentece is 이것이 니가 나의 친구인 이유이다
this = why -> 이것 = 이유
and this is why you are my friend = this is the reason that you are my friend
right? so your sentence is also abbreviation too
if you wanna learn about abbreviation, then you should learn about basic formal form first
if you do opposite, then... you gonna be confused pretty often ^^