Why does cucumber skin kill ants?
Cucumber contains a compound called trans-2-nonenal (reference 1 and reference 2) that repels insects. This particular compound (reference) has can also be used in insecticide foams for repelling ants (reference)