Wiegand Data aFormat Reader and Arduino

It worked when I shared ground, can someone explain why you have to do this