Lots of vertebrates reproduce asexually, with this being the preferred or only form of reproduction for many lizard species. You can find out more about this on the Wikipedia article about parthenogenesis:
Most reptiles of the squamatan order (lizards and snakes) reproduce sexually, but parthenogenesis has been observed to occur naturally in certain species of whiptails, some geckos, rock lizards, Komodo dragons and snakes. Some of these like the mourning gecko Lepidodactylus lugubris, Indo-Pacific house gecko Hemidactylus garnotii, the hybrid whiptails Cnemidophorus, Caucasian rock lizards Darevskia, and the brahminy blindsnake, Indotyphlops braminus are unisexual and obligately parthenogenetic.
As for how that came to be:
Parthenogenesis has been studied extensively in the New Mexico whiptail in the genus Aspidoscelis of which 15 species reproduce exclusively by parthenogenesis. These lizards live in the dry and sometimes harsh climate of the southwestern United States and northern Mexico. All these asexual species appear to have arisen through the hybridization of two or three of the sexual species in the genus leading to polyploid individuals. The mechanism by which the mixing of chromosomes from two or three species can lead to parthenogenetic reproduction is unknown. Recently, a hybrid parthenogenetic whiptail lizard was bred in the laboratory from a cross between an asexual and a sexual whiptail. Because multiple hybridization events can occur, individual parthenogenetic whiptail species can consist of multiple independent asexual lineages. Within lineages, there is very little genetic diversity, but different lineages may have quite different genotypes.
If your dragons only reproduce asexually when their population is low and prey is abundant, switching to sexual reproduction in other situations, then the mechanism above might not be adequate. One hypothesis I have for you is that females are able to produce both haploid and diploid eggs, but this is controlled by hormones and the trigger is the surplus in food combined with lack of contact with members of the same species. Asexual reproduction may always happen, but it will be rare (say, less than a birth in every 10,000) if there are many available mates or little available food.