While the story of the apple is a popular anecdote, it's important to remember that it's likely apocryphal. There's no evidence that Newton was actually struck by an apple, but the story serves as a good illustration of his thought process.
Here's what we know:
* Newton was thinking about gravity. He was already working on his ideas about gravity and motion when the apple incident is said to have occurred.
* The apple may have served as a catalyst. Seeing the apple fall might have triggered a train of thought about why it fell straight down, rather than upwards or sideways. This could have led him to consider the force of gravity acting on the apple.
Regardless of the actual events, the story helps us understand how Newton's mind worked: he saw a seemingly simple phenomenon (a falling apple) and used it as a starting point for investigating a larger universal concept.