In the wild, they lay their eggs on land. In soil and leaf litter. In captivity however they don't always have access to an idea nesting site, especially if they're kept in a tank with a turtle dock...
Most butterflies lay their eggs on plants that will be eaten by the caterpillar, when it hatches. Some species lay their eggs on the tops of leafs, some on the bottom, some at the leaf axils, some on...