I can explain it if you want Gut how indepth do you want it. The evidence against Amstrong is largely eye witnesses (former teammates and a lot of them), his biological passport (ie they are comparing his blood work from 99 to his comeback in 09) and a few other bits of evidence like how his entire team of doctors have been banned for life (
http://www.cyclingnews.com/news/ferrari-del-moral-and-marti-banned-for-life-in-us-postal-case) and the fact that literally every cyclist of note during that era has either been caught using PEDs or has admitted it. These are the cyclists who ran second to him in his run Alex Zulle (admitted blood doper), Jan Ulrich (admitted blood doper), Joseba Beloki (implicated in operation Peurto but cleared), Andreas Kloden (accused of blood doping) and Ivan Basso (admitted blood doper)
How do they not get caught. Well athletes don't go to meets with drugs in the system. There are largely three ways of cheating in this matter. PEDS basically steroids, blood doping and gene doping. Take blood doping which is probably the biggest issues in cycling. EPO is very tricky to catch after a fairly short period of time but the athlete still takes the benefits of it. Its only in the last decade that any kind of real test has been made for EPO which is why things like biological passports are the future because instead of testing to see if they are literally pissing hot the testers are looking for biological trends. This isn't all that new a very basic form of biological passport is testosterone over epitestosterone ratio which is used to detect anabolic steroids. Take MMA fighter Alistair Overeem who got popped for having a too high ratio. It wasn't a specific drug in his system but irregularities with his biological passport. When testers have years upon years of samples to run against its going to be a lot hard to cheat.
This forum takes accusations against athletes seriously so for arguments sake lets pretend there is a country in central Asia that has no central doping agency. Lets pretend this country produces a lot of athletes in... I don't know picking a sport off the top of my head uhhh Weightlifting. Lets say that during the offseason while out of competition these athletes roid their eyeballs off but steroids don't have a particularly long half life in the body so by the time they get to competition they piss clean. Its not like they won't benefit from the results of these steroids and still win gold medals.
There is also a very good chance agencies don't want to ping athletes so they just pay lip service to it. The International Tennis Federation was pretty cool with Serana Williams literally hiding from a drug test because she "thought it was a criminal".