First, law is not science and people and the situations they get themselves into are infinitely complicated.
In the US for an obviousness rejection to hold water on it face the examiner needs to find at least one reference that is in the same or closely related field or in a different field but attacking an analogous problem, where some of the elements of the rejected claim are present.
Then other references need to be cited so that all the elements of the claim are found within them.
An argument needs to be presented that someone of ordinary skill in the field would think to put the references together to achieve the claimed invention. Of course hindsight bias makes this analysis hard to do fairly. Once you know the answer it’s hard to put yourself in the shoes of someone who doesn’t know.
Rejections can be overcome. One way is to show the device of the base reference must be twisted so that it can’t be used for its original purpose in order to make the combined invention. Drilling holes in a bucket and turning it upside down would defeat the original function of the bucket, as a simple example.
Also the examiner may not have actually included all if the elements. Another way to address an obviousness rejection is to narrow the claim, adding more limitations. Just arguing that the person of ordinary skill wouldn’t make the combination is hard to make convincing but you can submit expert affidavits.
Before a famous case about 20 years ago the examiner needed to find a reference that provides a teaching, suggestion of motivation for doing that combining. Now TSM is nice to have but not required.
The fictional person of ordinary skill is assumed to have extraordinary knowledge. They know everything relevant that has been published in any language anywhere at any time before the priority date.