Both have to do with things that the a speaker wants to do, but they have quite different meanings--
In many cases "I would like" is a more polite way of saying "I want."
In restaurants, for example, we often say "I would like the soup of the day...etc." It can also be a way to express plans or desires, like "I would like to travel to Spain one day" or "I would like to be a better dancer."
"I would rather" is about preferring one thing over another:
"I would rather work ten hour days and have three day weekends than work a regular nine to five"
"I would rather eat pizza than pasta."
"I would rather travel to Spain than Italy."
Often the formula "I would rather [first thing] than [second thing]" is used, but it can still be used when of the two options is implied.
A: Do you want to go to the party later?
B: I would rather not.
A: Would you like to spend the weekend in the forest?
B: I would rather rest at home.