Answer:
They're both fiction, but easiest is probably to say that Lord of the Rings is a typical example of Fantasy, while Star Wars is a typical example of Science Fiction.
More magic than rockets = fantasy
More rockets than magic = sci-fi
Elves and dragons = Fantasy
Aliens and robots = Sci-Fi