The traditional way to create ruffles or gathers is to make a loose (6 or so stitches per inch) straight stitch, and then pull the bobbin thread. The problem with this method is that the bobbin thread tends to break over long lengths.
A better way is to zig-zag stitch over heavy cord, such as 9 mm to 1.4 mm nylon shade cord. (Sometimes heavy-duty smooth floss is used instead, but I prefer small-diameter shade cord, as it is very strong and easy to sew over.) First, the shade cord is knotted at one end, so that it won’t accidentally pull out while sewing over it. Next, do a wide zig-zag stitch over the cord, making sure to stay inside the seam allowance so that the stitching won’t show. When finished, back-stitch, so that the zig-zag stitch doesn’t pull out when you pull the shade cord. Do not stitch through the shade cord at any point. Tie a knot at the other end of the shade cord, so that it will not accidentally pull out of the stitching. Now simply pull on the shade cord (at either end) to gather.
To make low-bulk gathers, small pleats can be substituted for gathering. The small pleats lay flat, but look similar to gathers. Instead of gathering, simply pinch small (1/2″ or less) pleats and stitch over them. A pleating fork can be used to help form the pleats.