To be obvious, the initial burden in placed onto the patent examiner. They must be able to find the same (or very similar) teachings in the prior art which could include past patents, articles, websites, etc. They will then attempt to merge these together and make a statement that your work would be simple, routine, and odviouss to combine these.
It is then up to you (and your patent attorney) to demonstrate it is not obvious. We have some tricks and methodologies we use to do this.