The top performing countries are countries which do the three things the studies recommend: hire the best teachers, get them to do their best, and intervene when students fall behind. In South Korea, primary schools recruit teachers from the top 5% of college graduates, Singapore from the top 30%. Finland requires primary school teachers to have a master's degree. Yet they don't offer as much money as possible to attract the best, nor try to obtain as large a pool of teachers to choose from as possible--countries with the highest teacher salaries, Germany, Spain, and Switzerland, are not among those with the best-performing schools.
Singapore and Finland both provide significant teacher training and encourage teachers to share information and lesson plans. In Korea, secondary school teachers have lower status than primary school teachers: "Its primary school teachers have to pass a four-year undergraduate degree from one of only a dozen universities. ... In contrast, secondary-school teachers can get a diploma from any one of 350 colleges, with laxer selection criteria."
The McKinsey study offers an explanation for why there's no correlation between spending or class size and student performance. Increasing spending doesn't guarantee that you get the best teachers, train them well, or intervene appropriately for students who fall behind. Reducing class size means a need for more teachers, which all else being equal means lower salaries and lower status, when the apparent way to succeed is to be more selective about who is teaching, not less.