Select "Custom" terrain, then click and drag on the map to raise/lower terrain. Hold shift to lower.
Marching squares walks a grid, classifying each cell by which corners are above the threshold. The 16 possible cases determine where contour lines cross cell edges.