Solar flares and coronal mass ejections are among the most prominent manifestations of the magnetic activity of the Sun. The strongest events of them tend to occur in active regions (ARs) that are large, complex, and dynamically evolving. However, it is not clear what the key observational features of such ARs are, and how these features are produced. This article answers these fundamental questions based on morphological and magnetic characteristics of flare-productive ARs and their evolutionary processes, i.e., large-scale flux emergence and subsequent AR formation, which have been revealed in observational and theoretical studies. We also present the latest modeling of flare-productive ARs achieved using the most realistic flux emergence simulations in a very deep computational domain. Finally, this review discusses the future perspective pertaining to relationships of flaring solar ARs with the global-scale dynamo and stellar superflares.