There are several methods of detecting exoplanets[1], the method you're referring to is the easiest and is called "transiting". Since it's the easiest, most exoplanets have been discovered with this technique. As you've guessed, it is highly unlikely for the stars and planets to align this way, and the general hypothesis as to why we've discovered so many is that there's a lot of planets out there[2].
[1] https://en.wikipedia.org/wiki/Methods_of_detecting_exoplanet...
[2] https://www.nasa.gov/home/hqnews/2013/feb/HQ_13-057_Kepler_T...