A couple years ago, I asked a 7th cousin to test his YDNA to 37 markers.
The Y chromosome is passed from father to son without combining with the mother's DNA. This means that my Y chromosome is identical to my father's Y chromosome, whose Y chromosome is identical to his father's Y chromosome, and so forth, back through the generations, through millions of years, back to the beginning of the Y chromosome and sexual reproduction.
Of course, this isn't strictly true. While DNA copies itself with amazingly high fidelity, small copying errors do sneak in over time. Sometime a small part of the DNA copies incorrectly. Sometimes a small part of the DNA copies correctly but then instead of copying the next section of DNA, it repeats the copying the previous section, like a record skipping back.
Those parts of the DNA which repeat are prone to repeat again, sometimes resulting in dozens of repeats. When this happens in wrong part of the DNA, serious problems can occur but it often occurs in non-critical areas, without causing serious problems.
All human males have several locations in their Y chromosome prone to repeat (short tandem repeats) again and again. Since these repeats are inherited by their sons, over many generations, some men have more or fewer repeats than other men at these locations (STRs). By studying how many repeats are in each STR, we can determine how closely these men are related. Since these repeats happen every few generations, if you have an identical number of repeats at each STR then you are related within a very few generations.
New repeats aren't regular, however; they are random. You may get multiple additional new repeats in a generation or none for several generations. So if you have a different number of repeats at may STRs, your common male ancestor might still be recent but he may have also lived hundreds or even thousands of years ago.
There are hundreds of STRs on the Y chromosome. The simplest test looks at only 12 STRs; those most likely to have repeats. However, this really doesn't tell you much; it's simply too few STRs. A more detailed test looks at 37 STRs. If you match on that many, you are likely to be a very close relative. However, several differences does not mean you are not closely related. Some of those STRs change repeats very quickly, adding or dropping a repeat.
My 7th cousin, whose surname is Simpson, whose paper trail points to William Simpson, who died in Delaware in 1757, as our common ancestor. After testing his DNA on 37 STRs, he had a difference in repeats on 3 STRs. This, along with the paper trail and the common surname, pretty much proved that we were 7th cousins. However, the DNA evidence alone was not overwhelming.
We recently tested my cousin's at 67 STRs. When compared to mine, he matched on all additional 30 STRs, meaning we still only differ on 3 STRs. However, that difference is now out of 67 STRs, not 37. This is much stronger evidence that we're indeed 7th cousins. I suspect if we upgraded to 111, he would still only differ on 3 or 4 STRs.
So if you are YDNA testing, it pays to test at least 67 STRs and perhaps 111 might even be better. If you don't, you risk missing relationships that you can't see with the less detailed test. If my cousin didn't know his genealogy or an ancestor had changed surnames then we never would have recognized the relationship.