The intellectual property laws generally reject this "sweat of the brow" doctrine.[1] The idea is, that someone should be able to get a patent for something that results from a flash of insight rather than years of expensive R&D.
I think rejection of this doctrine is a grave mistake as applied to patents. Essentially, it fundamentally misunderstands the nature of innovation in the 21st century. A new invention does not happen because someone has a clever idea one day while mulling over a problem during lunch. That may have been true in the early 20th century and earlier, but it's not true today. Today, invention is driven by research labs staffed by expensive PhDs using even more expensive capital equipment. The purpose of patents in the 21st century is to protect and be able to transact in the results of this capital-intensive R&D.
E.g. Adonit has a new iPad stylus that's 1.9 mm versus the 6 mm typical for iPad styluses (https://adonit.net/jot/script). The capacitive touch matrix on the iPad normally cannot pick up on such a narrow point, so they use some active sensing technology that relies on measuring the electronic field emitted by the capacitive matrix and feeding that back to special software over Bluetooth. For this they have a patent. This was not a flash of insight. This was the result of measuring EM field strength with expensive equipment, buying lots of iPads to test product variability, doing lots of experiments and iterating the design. The purpose of a patent here is to keep companies from free-riding on all that R&D, not to reward anyone for a flash of insight.
By rejecting sweat of the brow doctrine in the context of patents, patent law has become divorced from its underlying economic justification: the prevention of free-riding. The magnitude of the disincentive created by free-riding depends very much on the capital investment that went into the invention.
[1] Sweat of the brow doctrine is more typically used in the context of copyright, but is applicable to a degree for patents as well. The doctrine has opposite effects in the two contexts. In copyright, it has been used to reject copyright-ability for things like phone books that might take work to compile, but aren't "original works." However in patents, it has been used to justify granting patents for "inventions" that weren't a lot of work to invent.