This is the act of a good male friend (or sometimes a boyfriend) moving closer to a female friend of his or even dancing with her so that a sketchy, unknown man does not start to get too close. This act is often performed in crowds (ie. clubs).
Often times, if there are more than a 1:1 ratio of guys to girls, a single guy may have to cockblock for many of his female friends/companions.
This is usually appreciated by the female, who generally thanks the male in the cab ride back.
That sketchy guy was hitting on my friend so I had to act like her boyfriend, thus cockblocking that sketchy guy from grindin on my friend!