We make a non-member function a friend of a class when we want it to access that class\'s private members. This gives it the same access rights as a static member function w
The difference is clearly expressing the intent of the relationship between the class and the function.
You use friend when you want to intentionally indicate a strong coupling and special relationship between two unrelated classes or between a class and a function.
You use static member function when the function is logically a part of the class to which it is a member.