They were both Kings of France. Louis XV died because of smallpox and Louis XVI died on the guillotine. Given the choice, most rational humans would opt for the guillotine.
Louis XIV was the great-grandfather of Louis XV. Because Louis XV's grandparents, parents and brothers all died, he erherited the throne and became King of France (crownprince) at the age of 6.