It would take a whole book to get into the fine points of DNA testing, but briefly:
A man gets his Y chromosome (which is what makes him a male) from his father, who got it from his father, who got it from his father... back and back. The DNA changes very seldom, so two lines of male descent from a common ancestor within the last several hundred years will have identical or very similar DNA patterns on their Y chromosomes.
The autosomal DNA test looks at all your ancestors. You will share lots of DNA with your siblings, less with your first cousins, still less with your second cousins, etc. There's usually enough DNA in common to identify 3rd cousins and sometimes even more distant relationships. If your father tested at 23andMe (where my uncle John Wright tested), they might share a segment of DNA that would show up in the Relative Finder report. The 23andMe test also covers lots of other items of interest for ancestry as well as health. You can visit their website for more details.