Fragmentation of elephant habitats has forced animals to stray into human settlements in search of food, often with fatal consequences.