Factors determining the trapping success of Pinguicula vallisneriifolia, a carnivorous plant of southern Spain which grows in limestone rock walls are examined. Several ecological aspects are considered jointly, such as the abiotic environment in relation to spatio-temporal prey abundance, behaviour of prey and kleptoparasites, and plant traits that directly determine trapping efficiency, such as the amount and retention capacity of the mucilage under contrasting ecological conditions. Observations are combined with field experiments in four P. vallisneriifolia microhabitats differing in radiation and substrate wetness. The abundance of flying insects and the mucilage-retention capacity mainly determined differential prey captures between habitats, while kleptoparasitism had a similar quantitative effect in all habitats. Irradiance intensity and insect availability correlated negatively, i.e. in sunny, dry places, flying insects were scarce, whereas in shady, wet places, insects were abundant. Plant mucilage secretion also depended on light availability, and the adhesiveness of the droplets correlated negatively with insect availability (that is, more mucilage adhesiveness in the sunny and wall habitats, with fewer insects available, and vice versa in the shady habitat). As a result, plants growing at the extremes of the abiotic gradient (sunniest and shadiest habitats) trapped less animal biomass. This fact poses a schizophrenic problem for P. vallisneriifolia, which, as a green plant, needs both water and light for photosynthesis, and, as a carnivorous one, animal prey for nutrients.