The ATC primary radar uses a number of electronic tricks to avoid useless targets. One of the tricks is a moving target detector (MTD) that filters out any target moving slower than some certain speed. There are also filters to dump out "targets" that appear on one sweep of the antenna but don't appear on subsequent ones. With modern software controlled primary radars you can specify an azimuth/range/altitude to ignore the target return from because you know there is a building/billboard/whatever there but not an aircraft.
Secondary (beacon) radars rely on the transponder response with codes, altitudes and such and sometimes the beacon doesn't respond for a time around or two or the interrogation pulse isn't received. For this reason ideally the targets on the ATCO's tube is made up of an integration of primary and secondary returns on the theory that if one doesn't work well the other will and the targets provided on the display will all be valid and all have a pretty little data block attached.
TCAS uses the transponders of equiped aircraft and will either interogate itself or use the transponder replies to ATC interrogations depending on the flavor of TCAS you have. The raw responses are processed and displayed and in the ultimate version of TCAS resolution advisories provided based on the logic embedded in the TCAS firmware.