There are two types of radar, primary and secondary.
Primary radar sends out a directional energy pulse which is reflected by metal objects. How long it takes the reflected pulses to return indicates how far away the objects are. That's it.
Secondary radar sends out a directional radio pulse, and transponders in cooperating aircraft will reply by sending various coded messages. Mode A just contains a four-digit code assigned by ATC (or one of several generic codes). Mode C also contains the aircraft's altitude. Mode S contains a lot more data. If an aircraft doesn't have a (working) transponder, it doesn't reply and therefore doesn't show up on secondary radar--though it should still show up on primary radar.
In both cases, you'll notice the only way the radar site can "find" the aircraft is by measuring the time between sending the interrogation and receiving the reflections (for primary) or replies (for secondary), which gives distance, and the azimuth of the antenna when the pulses were sent/received, which gives direction. Since nobody else knows those things, they don't know where the aircraft is just from receiving the reflections/replies, only that it's somewhere above the horizon (since these frequencies are line-of-sight).
Aircraft with TCAS send out interrogation messages very similar to secondary radar, but rather than a rotating antenna, they have a loop antenna with some clever processing to get a rough bearing for the replies. That isn't nearly as accurate, but it's good enough to know whether you're about to collide with another plane--and if so, whether you should climb or descend to avoid it.
ADSB is completely unlike radar. ADSB aircraft periodically (roughly once a second) transmit their position, identity, etc. in the blind, which means that anyone who receives the messages will know exactly where each aircraft is. No interrogation required.