A patent is a legal right granted by a government to an inventor, giving them exclusive rights to their invention for a certain period.