King Nriga gave away a million cows, one came back, no one noticed. The recipient missed the cow, followed her trail and stood in front of the stable. Nriga had already given the cow to someone else, who was just driving it home.
The betrayed followed him. There was a fight. Nriga begged the two men to forgive him, he would give them another hundred cows each.
They cursed him to become a lizard. An avatar of Vishnu born into the Yadava Clan would redeem him. They left the cow. Nriga handed the throne over to his son Vasu and asked him to dig a cave in a well where he could stay as a lizard. Samba, the son of Krishna, while playing, spotted this giant lizard when his ball fell into a well. He got his father who touched the lizard and it dissolved.
Read about Nriga here