In order for an invention to be patentable, the invention must be both "novel" under 35 U.S.C. § 102 and "nonobvious" under 35 U.S.C. § 103.
The manner in which novelty is most often assessed is by comparing the invention, as claimed by the inventor, with the prior art; that is, the pre-existing body of knowledge. If the claimed invention is identical to that shown in the prior art, the invention lacks novelty and is not patentable. In making this determination, the examiner is not permitted to dissect the prior art and use components from several sources; a single prior art reference must disclose the entire invention in order to be rendered unpatentable. Note that your own activities may defeat novelty as well. Those activities can include a sale, offer to sell, or public disclosure of your product or invention.
Even though an invention is novel, it must not have been obvious to a person skilled in the relevant art at the time it is made. When examining an application for patentability, the examiner can combine the teachings of several patents to conclude that an applicant's invention is obvious in light of the prior art. Generally speaking, an invention is non-obvious if analogous prior art does not suggest or teach the claimed invention and does not provide motivation for a person having ordinary skill in the art to modify the prior art to arrive at the claimed invention.