"he found the secret keyhole" is the best answer for information given.
When he reached the Lonely Mountains, the group almost gave up on the adventure, because the daylight ended on the day that they were suppose to show up. However, Bilbo stayed, and was able to see that "The last light of Durin's Day" was really the moonlight, which signed on the keyhole. With that, they were able to enter into the mountain without Smuag knowing (at first)
hope this helps