Most of Earth's diversity has been produced in rounds of adaptive radiation, but the ecological drivers of diversification, such as abiotic complexity (i.e., ecological opportunity) or predation and parasitism (i.e., ecological necessity), are hard to disentangle. However, most of these radiations occurred hundreds of thousands if not millions of years ago, and the mechanisms promoting contemporary coexistence are not necessarily the same mechanisms that drove diversification in the first place. Experimental evolution has been one fruitful approach used to understand how different ecological mechanisms promote diversification in simple microbial microcosms, but these microbial systems come with their own limitations. To test how ecological necessity and opportunity interact, we use an unusual system of self-replicating computer programs that diversify to fill niches in a virtual environment. These organisms are subject to ecological pressures just like their natural counterparts. They experience biotic interactions from digital parasites, which steal host resources to replicate their own code and spread in the population. With the control afforded by experimenting with computational ecologies, we begin to unweave the complex interplay between ecological drivers of diversification. In particular, we find that the complexity of the abiotic environment and the size of the phenotypic space in which organisms are able to interact play different roles depending on if diversification is driven by ecological opportunity or necessity. We find that in some ecological situations, both mechanisms drive similar levels of diversity. However, the phenotypes that hosts uncover while coevolving with parasites are dramatically more complex than hosts evolving alone.