People say it to show that they have beaten someone else or scored higher in a game or any competition. They say it to the person they are beaten or have beaten. They are showing off about it. For example, if someone scores a point in basketball, he might say it to the guy who tried to block him. "In your face!"after the ball falls through the hoop.
People often say... "In your face, sucker!" It is aggressive, but friends would use it with each other for fun as well.