In Machine Learning, what is the point of using stratified sampling in selecting test set data? I am currently learning machine learning via this book "Hands-On Machine Learning with Sci-kit learn and Tensorflow" by Aurelien Geron. 

In page 76 and 77, the author talks about using stratified sampling so that your test set would be more representative of the whole data. I didn't really understand the point of this since it would not affect the accuracy of your training model ? or how would selecting better test sets affect the accuracy of your training model ?
When the distribution of your data is balanced or you have enough samples of each class, a normal shuffle split will work well. But if your data distribution is unbalanced and one of the classes is in minority, you do stratified sampling so as to ensure that your train and test splits represent the true nature of your data. For more details take a look here.