A patent is a contract between the inventor and the State. Jon Gowshall at Forresters provides an overview on the inventor that agrees to make public their technical contribution to their chosen technical field and, in return, the State grants the inventor a monopoly right, to prevent others exploiting that technical contribution for the life of the patent.
https://international-pharma.com/wp-content/uploads/2014/01/Thinking.pdf