The authority that God has given to man to act in His name is called the Priesthood. And to the presiding bearer of the Priesthood, God gives the Keys of the Kingdom, or in other words, the Keys of the Priesthood. The presiding bearer of the Priesthood is the President of the Church of Jesus Christ.
When Jesus Christ was born, the world was again in apostasy. Jesus was a prophet, but He was also more than a prophet. He was the Son of God. Through Him, God restored the truths of the Plan of Salvation. Jesus established His Church, paid the price of sin, and was resurrected.
But as you know, the world eventually rejected Jesus and His apostles, and it fell into apostasy. That is, no one held the authority to act in the name of God. No one held the Priesthood or its Keys.
In the early nineteenth century, a young boy in upstate New York wondered which church to join. His name was Joseph Smith. The many churches in his area said that it didn't matter which church you joined, as long as you accepted Jesus. But Joseph recognized that the several churches' good-will disappeared once people joined separate churches. The different churches fought over the meaning of the Bible and how to be saved.
Joseph was so confused that he turned to the Bible himself. One day, Joseph read James 1:5 which says if anyone lacks wisdom, he can ask God, and God will give him the wisdom he seeks. Joseph decided that if anyone lacked wisdom, it was him and decided that he would ask God which church to join.
To read Joseph Smith's own account of what happened click here.