Although Germany and the Soviet Union were not necessarily “at odds” there were reasons to believe that they would not remain on peaceful terms for long. Actually the phrase “creeping up to war” has been used by the Soviet Union regarding the time period immediately before the war.
Germany wanted control of all Eastern lands and this would include the Soviet Union. The Soviet Union was not at its strongest at this time and the German army had definitely grown and was stronger. The German army had, in fact, taken the country of France in only six weeks.
Germany surely knew also that the Soviet Union had possession of many resources the German’s would have found useful. Also, if the German army could overcome the Soviet Union, they would most likely have the resources to build an unbeatable army. Not to mention, if Germany won the Soviet Union, there would be less allies to which Great Britain could look to. With the Soviet Union in their control, the British would most likely be a very easy target.
For more details: http://latvianhistory.com/2011/11/27/why-hitler-invaded-the-soviet-union/