Jafar uses Aladdin to retrieve the lamp because he is a 'diamond in the rough' and is allowed to enter,they must not touch anything but the lamp.
Aladdin and Abu were on there way to find the lamp and a magic carpet was showing them the way, Abu tries to take a large Ruby and the whole cave starts to shake.
The beggar asks to have the lamp, Aladdin gives it to him and the beggar then reveals a dagger, intending to kill him. Luckily, Abu bites the beggar, and both Aladdin and Abu fall back into the cavern, as the giant Tiger's Head disappears under the sand.
Deep within the cave, Aladdin begins to examine the lamp, finding a worn inscription on the side of it. Rubbing it, the lamp then produces a large blue genie. The genie tells Aladdin that for rubbing the lamp, he is entitled to three wishes