The rise of Rap, Hiphop and its derivatives has largely been due to its compaction of recording setups. It is much more inexpensive to record hiphop and trap, as well as other electronic genres. It saves on space, if not instruments and equipment, which turns out to be the dealbreaker. Studio time is expensive and practice space can be difficult for some musicians such as drummers to obtain that it can easily bankrupt musicians and record labels both.
So electronic music has an edge there.
So what gives hiphop and trap the edge over say house music? It is excellent lounge music that also allows a single performer to draw the attention of the audience. House music has the problem of using vocalists who live only on the record. There was a moment when nightclubs had stages that allowed singers to take the stage but for some reason they fell to the wayside in the early 2000s. Or that was the case in North America. In Europe, it is different with a long-standing discotheque culture there that draws upon schlager performance spaces to maintain a stable of performers.