One is called internal validity, and the other is external validity. Internal validity is the confidence you have that your results are accurate in describing the population being studied. External validity is your ability to generalize from the study to a larger population. Now, random assignment solves a lot of internal validity problems. That is, if students are randomly assigned to two different groups, then we can have very high confidence that any differences we observe between the outcomes of the groups after a period of time are attributable to the different treatment each student received after being assigned to the group.
Some students get one treatment and others get a different treatment based on chance alone.
We're talking about something that's bigger. The Tennessee STAR Study, which compared students assigned at random to classes of either 25 or 18 students, produced a benefit of .21 standard deviations after two years. Using standard deviation units is a convention among researchers that allows you to compare across different kinds of tests where the points might be different. Education researchers think of .2 or .3 standard deviation gains as being moderate, and larger than that as being fairly big. Frankly, it's hard to find any intervention that produces large gains in education.