The PIWI-interacting RNA (piRNA) pathway is a conserved defense system that protects the genome integrity of the animal germline from deleterious transposable elements. Targets of silencing are recognized by small noncoding piRNAs that are processed from long precursor molecules. Although piRNAs and other classes of small noncoding RNAs, such as miRNAs and small interfering (si)RNAs, interact with members of the same family of Argonaute (Ago) proteins and their function in target repression is similar, the biogenesis of piRNAs differs from those of the other two small RNAs. Recently, many aspects of piRNA biogenesis have been revealed in Drosophila melanogaster. In this review, we elaborate on piRNA biogenesis in Drosophila somatic and germline cells. We focus on the mechanisms by which piRNA precursor transcription is regulated and highlight recent work that has advanced our understanding of piRNA precursor processing to mature piRNAs. We finish by discussing current models to the still unresolved question of how piRNA precursors are selected and channeled into the processing machinery.