There is both a written test as well as a flight test for a pilot license or rating, be it Sport, Private, Inst, Com, etc.
So how do you prepare and pass?
First the strict news: you do actually need to learn and study this written stuff, some of it may be minutia, but some is actually important in safe and legal flying. It's not just riding around in a plane having fun and the knowledge just soaks in you like the odor of cigarettes in a smoke filled bar.
Now the good news: if you study and cover the material , it is not very hard to pass the written test. I used to be a volunteer tutor to a 7th grade math class. That was about my math peak, I was about equal to the lower students in 7 th grade, but I worked cheap.
So the academic difficulty of a written course for sport or private is about like a junior high course, not at all hard, IF YOU DO THE WORk.
The other easy point is that the prep courses have all the test questions, VERBATIM, that the FAA can ask. You just have to learn them, hundreds of them. I think when I took my private back in 1979, there were 600 questions in the FAA base and on the test they would ask you a 50 of them; again word for word.
And almost unbelievebly you only have to make 70% to pass. Now any number of people make 100%, like JerryRosie says he did. I missed one question, still bugs me to this day. If you squeaked by with a 70, there would be almost a third of the material you don't know; not a good way to start, but legal.
I had a friend who flew for more than a year with a CFI in a rented 172, but for some reason he just would not study or learn the written. Finally with no study he took the test and failed with a 69. He finally passed after a year and a half, I don't think he flys anymore.
Another couple of good reasons for learning the info well the first time, is that if you make a 100 on the private, then later if you take the commercial, you will already know the majority of the info.
Also there is an oral quiz portion of the flight test. The examiner will likely look at questions you missed on the written and ask them again for the oral and this time a 70 pass score may not get you by. I"d guess the CFI is not too demanding for a Sport pilot, and can be very thorough for a CFI test, where flying the plane may be the easy part.
There is a lot of knowledge to know and if an examiner wants to be very demanding he can likely find something a student doesn't know. If you make a 95 on the written, the oral is likely to be shorter.