At the close of World War II , Germany was divided into two separate countries governed under separate ideologies of democracy and communism .