As to how they found out, there is no way of knowing. It  is also irrelevant, except to satisfy curiousity.The important issue is that I do not believe that employers may discriminate or retaliate against employees or prospective employees due to union or collective bargaining activities. If that is what happened, you may have a causee of action; it would be worthwhile to consult with an employment law attorney, specifically one with union-related experience; indeed, possibly the union itself can recommend someone. Good luck.