same transaction or occurrence definition

same transaction or occurrence means is there a “logical relationship” between the claim and the counterclaim.