Why did inventors apply for patent?

Patent protection gives inventors a temporary monopoly, more or less as a reward for coming up with the idea, and as a period of exclusivity where they can recoup any investment made in the development of the idea.