Trends in HIV infection vary by different regions and populations globally. In 2018, newly diagnosed HIV infections decreased in North America by 12% but increased by nearly 30% in Eastern Europe since 2010. The HIV epidemic in Eastern Europe is concentrated primarily among people who inject drugs (PWID), who accounted for 12% of HIV infections globally and over 40% of those in Eastern Europe and Central Asia in 2018. In North America, men who have sex with men (MSM) carry the greatest burden of HIV acquisition, accounting for 17% of newly diagnosed cases globally and 51% of new infections in North America and Western and Central Europe. Behavior-change interventions designed to reduce HIV transmission across HIV-affected populations may work through many mechanisms and are often most efficacious when targeted within specific subgroups. Yet, mechanistic and subgroup analyses of intervention efficacy on HIV seroconversion in two randomized controlled trials (RCTs) among key populations (i.e., PWID in Ukraine and MSM in the United States) have yet to be comprehensively explored. Employing these methods could provide insight on how and for whom the interventions worked and could be implemented to maximize their protective benefits. The first chapter of this dissertation provides a summary of the HIV epidemics and certain related risk factors in key populations, specifically PWID in Ukraine and MSM in the United States. This chapter also introduces important methods that can be applied to HIV prevention intervention research to better parse out how and for whom interventions work best. The second chapter examines the mediating role of network communication about HIV-related topics in the efficacy of a social network intervention on HIV seroconversion in a RCT among PWID in Ukraine. The third chapter uses data from the same RCT among PWID in Ukraine and examines whether geographic region and social injection practices modified the effect of the social network intervention on HIV seroconversion. The fourth chapter examines whether study site and alcohol use history modified the effect of the intervention in EXPLORE on HIV seroconversion among MSM in the United States. The final chapter of this dissertation summarizes the potential impact of these findings and recommended future work to help end the HIV epidemics among these key populations in comparable settings.