We never let the computer study with the same questions as the final exam — that would be cheating!
Imagine it like this: Your teacher gives you 100 practice questions (training data) and then 20 different questions for the real test (test data). That way, your grade really shows whether you understood the subject, not just whether you memorized the flashcard.
Examples:
So? Splitting the data keeps the computer honest — testing it on things it has never seen tells us whether it really learned, instead of just memorizing.