A university has the option to confer degrees to people who have not studied at its university. It is a way to show respect to the achievements of people, even outside the academic realm. An hounorary degree is such a way to hounor people.
Yale University in the United States has conferred a doctorate on the Kenya-born writer Ngugi waThiong’o. Read more about it here.