Suppose you employ the ten greatest minds on earth to conjure the greatest and best exam question for primary school mathematics imaginable. Let's call that question Q.
Suppose A is a valid answer to Q.
Either nobody is able to determine what A is (e.g. Q is please factor this big number into primes and give them an 2048-bit RSA modulus), in which case all primary school children fail the exam.
Alternatively, one person in the connected graph of all people that all primary school children sitting the exams know and who is willing to cheat discovers A during the exam. That person makes the answer available on a forum.
Now Q can be answered by any child typing "answer to Q" into Google. So you've turned an exam about "can you solve Q" into an exam about "can you type 'answer to Q' into Google and copy the first page onto this piece of paper".
These are assessing quite different things - the first gives you some insight into the pupil's ability to do work. The second does not.
I think the best possible exam system is one where you don't examine the children - you merely ask their teachers how bright the child is. Unfortunately this is too subjective and subject to corruption to be made official, but it's the best way of getting a picture of the child about how good that person is at doing work, by allowing the teacher to take into account other behaviours, obstacles and so on that the child encounters.
But as long as you have written exams, where all children are asked to complete the same questions, you're going to need to prevent cheating, because for any question Q, no matter how ingenious or clever you are, you're probably not want to just be testing the child's legendary ability at typing the question into google and copying the result onto paper.