SpaceX was in competition with Bezos' space company Blue Origin. SpaceX bid on the contract alone, while Blue Origin paired with Lockheed Martin and Northrop Grumman for the contract.
The goal of this contract is to provide a capsule that will carry two American astronauts to the moon by as early as 2024. However, these lunar missions are different than the infamous Apollo ones from the early 1970s. NASA aims to establish a long-term presence, possibly in the form of a base, that could be the foundation for missions to Mars.
NASA also plans to award a different contract that would allow individuals to travel to-and-from the moon.
Blue Origin losing this contract is a significant blow to Bezos. It was interpreted that he would focus more of his attention on the space venture after announcing his departure as Amazon CEO.