It's a "Top Secret Clearance," a certificate saying that you are trustworthy to perform top secret government work. Based on what I've heard from others, getting one includes taking a lie detector test, having family members, neighbors, and colleagues interviewed, and hopefully not too many other probing things. My impression is that any warm-bodied US citizen who doesn't have much of a record, and who knows the right things to say, can get a TSC unless their nationality gets in the way.
personally I haven't seen nationality get in the way. Actually, I've seen many folks that are either 1st or 2nd generation US citizens. But the rest of what you say is right, though not all clearances require a polygraph. Relatively few people get those if you include regular Secret and Public Trust positions.