"The answer, I think, is that in education and in science, as in fast food and popular culture, America is not really worse than the rest of the world, we are merely a few years ahead of the rest of the world. What we are seeing here will happen everywhere soon enough. Our colleagues abroad can take what scant comfort they can find in the promise that our dilemmas in science and education are on the way, along with Big Macs and designer jeans ... Most elementary school teachers are poorly prepared to present even the simplest lessons in scientific or mathematical subjects. In many places, Elementary Education is the only college major that does not require even a single science course, and it is said that many students who choose that major do so precisely to avoid having to take a course in science. To the extent that is true, elementary school teachers are not merely ignorant of science, they are preselected for their hostility to science, and no doubt they transmit that hostility to their pupils, especially young girls for whom elementary school teachers must be powerful role models. Even those teachers who did have at least some science in college are not likely to be well prepared to teach the subject."
At the graduate level (Master/PhD) I'd say it becomes comparable, but there were very few Canadian students compared to Chinese and Iranians.
That is really not that hard to explain. Once you solve hunger, clothing, mobility and housing. You basically take away the most important of human instincts which drive a person to work insanely hard for success.
At that point a person has to call upon his internal human enterprise to succeed. That's hard.
America is just a victim of its own success. This is also called decadence.
The U.S. produces many of the world's great intellectuals, inventors and engineers. So how does it do it if the education system is that bad? The answer is that it isn't. This is what I've observed:
Its K-12 education system isn't that great in general, but it's good enough.
Its colleges however do a good job filtering the non-academically inclined and catching up those remaining to the rest of the world in 4 years. U.S. college graduates are no worse than say UK college grads in terms of ability, even in technical disciplines. Elite U.S. colleges arguably produce students of equal or higher quality and the elite universities in most countries.
Taken broadly, U.S. grad schools are on par with the rest of the world. Its elite grad schools however are heads over heels better -- which is why everyone wants to go to grad school at a good US university. The funding is way better too.
Certain European countries like France, and funneling societies like India and China, produce more highly trained technical types at the college level, but these advantages wash out at the graduate level.
Most of the world optimizes education at the K-12 levels. The U.S. optimizes education at the tertiary level.