As the methods that the hominids used to find their food changed, they stopped using some organs of their bodies. As the use of these organs stopped, their bodies evolved to eliminate those organs.
As the hominids started relying on their legs for the purpose of locomotion and started using their hands for other purposes, their posture went on becoming more and more erect.
Along with the development of other body parts, the brain of the hominids also developed to become more efficient. This made the hominids develop the ability of comprehension.