Understanding the evolutionary processes shaping species distributions in both marine and terrestrial environments has been a central interest among evolutionary biologists, biogeographers, and ecologists. Species richness in a given region is directly influenced by three key processes: speciation, extinction, and dispersal. Variations in the rates and timing of these processes are responsible for shaping diversity gradients such as those observed along latitudinal, longitudinal, elevation, and depth gradients. These variations arise from a complex interplay of biotic and abiotic factors, encompassing climatic stability, geographical barriers, trophic specializations, productivity, competition, and predation. Macroevolutionary studies using phylogenies can illuminate these evolutionary patterns and processes over extensive timescales and diverse taxonomic groups. Specifically, integration of comprehensive phylogenetic trees, derived from extensive taxonomic sampling of both extinct and extant species, with thorough genetic analysis, and supplemented by ecological and morphological datasets, can facilitate identifying factors influencing diversification and biogeographic trends across taxa. The overarching goal of my dissertation is to understand how extrinsic (e.g., formation of historical barriers, temperature) and intrinsic (e.g., life history processes such as feeding mode, dispersal ability) factors may have shaped the evolution of two charismatic groups of marine reef fishes. The first two chapters aim at examining Syngnatharia, an extraordinarily diverse clade (>660 species) that includes trumpetfishes, goatfishes, dragonets, seahorses, pipefishes, and allies. The third chapter focuses on fishes in the order Acanthuriformes, which comprises surgeonfishes, the louvar, and the moorish idol (87 species). Despite progress made in unravelling the relationships of these and other clades of disparate marine fish groups based on a handful of genetic markers sequenced from a few representative lineages, the vast majority of the species lack phylogenetic placement. Additionally, very few studies have looked at genes associated with phenotypic or ecological changes in reef fishes from a macroevolutionary perspective. To fill in these gaps, my research aims to examine the evolutionary history of these groups using state-of-the-art approaches, including phylogenomics, phylogenetic comparative methods, and phylogenetically-informed genotype-to-phenotype (PhyloG2P) comparative genomic approaches based on whole genomes. In my first chapter, I applied an integrative phylogenomic approach to elucidate the evolutionary history and biogeography of Syngnatharia. I collected genome-wide DNA sequence and geographic distribution data for 169 species to cover ~25% of the species diversity and all 10 families in the group, and complemented these datasets with paleontological and geological information. With these datasets I inferred a set of time-calibrated trees and reconstructed the ancestral ranges of the group. I then examined the sensitivity of biogeographic analyses to phylogenetic uncertainty (estimated from multiple genomic subsets), area delimitation, and biogeographic models. After accounting for these uncertainties, my results reveal that syngnatharians originated in the ancient Tethys Sea at the Late Cretaceous, 87 million years ago (Ma) and subsequently occupied the Indo-Pacific Ocean. Throughout syngnatharian history, multiple independent lineages colonized the Eastern Pacific (6–8 times) and the Atlantic (6–14 times) from their center of origin, with most events taking place following an east-to-west route prior to the closure of the Tethys Seaway between 12–18 Ma. These colonizations were facilitated by the long-distance dispersal ability of syngnatharians during their pelagic larval stages or through rafting, such as with sargassum-associated species, aided by oceanic currents. For my second chapter, I examined factors driving syngnatharians species richness along the longitudinal diversity gradient across oceans and assessed whether patterns of morphological diversity are congruent with this gradient. I increased the taxonomic sampling of syngnatharians from my first chapter to 323 species (50% of the species diversity) to test three non-mutually exclusive evolutionary hypotheses proposed to explain the longitudinal diversity gradient: time-for-speciation, center of accumulation, and in situ diversification rates. I estimated diversification rates and body shape disparity broadly across the group, considering biogeographic regions within all three major oceanic realms (Indo-Pacific, Atlantic, and eastern Pacific), as well as within the Indo-Pacific region. The analyses showed that the extensive diversity of syngnatharian species in the Indo-Pacific region primarily stems from ancient colonizations, leading to in situ speciation during the Palaeogene, shortly after the Paleocene-Eocene Thermal Maximum (PETM), and subsequent lineage accumulation during the Miocene coinciding with the initiation of the Indo-Australian Archipelago (IAA) rearrangement. Conversely, the eastern Pacific and Atlantic regions exhibit lower regional diversities, largely due to more recent colonization events and the onset of diversification, with most lineages in these areas emerging during the Miocene. These findings strongly support the time for speciation and center of accumulation hypotheses. My study also reveals that a significant portion of syngnatharian morphological diversity originated early in their evolutionary history within the Tethys Sea, followed by a gradual decline in subclade disparity marked by the emergence of multiple adaptive peaks, particularly in head morphology. This suggests that while high species richness exists, it does not necessarily correlate with high morphological disparity across various biogeographic contexts. All in all, colonization dynamics explain the longitudinal diversity patterns of syngnatharian fishes across marine realms while morphological similarities persist among them. In my third chapter, I examined the ecological drivers of trophic transitions among fossil and extant acanthuriforms as well as the genomic basis of these transitions. By combining genomic data for 80 extant species (~93% of total diversity) with morphological characters for 32 fossil taxa, I inferred total evidence time-calibrated phylogenies. Using these phylogenies, I reconstructed the diet of acanthuriforms and investigated the number of times the planktivory lifestyle evolved, along with the geographic location and timing of these transitions. The analyses indicate an origin of acanthuriforms approximately 64 Ma following the K-Pg mass extinction event, with at least seven documented transitions to planktivory from non-planktivorous lineages, followed by at least four reversals to non-planktivorous diets. While the earliest transitions occurred in the ancient Tethys Sea, the most recent ones happened within the Indo-Pacific region. I then evaluated the effect of the convergently evolved diets on acanthuriforms’ diversification, finding no significant effect as diversification rates remain constant across trophic guilds. However, transition rates are higher from planktivores to non-planktivores compared to the opposite direction. Diversification of planktivore species does appear to be influenced by cool past climatic temperatures, although there is also a confounding effect from phylogenetic signal. Despite ecological and morphological factors commonly driving this trophic specialization, the extent to which this adaptive convergence is caused by convergent changes at the molecular level remains understudied in reef fishes. Therefore, in this study I performed PhyloG2P analyses, using newly-generated chromosome-level (Acanthurus chirurgus) and short-read (45 species) genomes to identify genes under positive selection across planktivore lineages and along branches where a transition to planktivory occurred. We identified a total of 91 genes that underwent convergent positive selection in planktivorous lineages, along with three genes unique to planktivores. These genes are implicated in metabolic processes and adaptations in body shape, consistent with the repeated instances of convergence towards a pelagic environment, which are associated with planktivory and specialized morphological traits. In summary, my dissertation explores the evolutionary processes shaping the distributions of marine fish species, highlighting the pivotal roles of speciation, extinction, and dispersal in driving diversity across oceans. My research also underscores the importance of integrating data from both fossil and living species to obtain a more comprehensive picture of the evolutionary history of groups. Through comprehensive analyses based on genomic, ecological, and morphological data, I emphasize the need to address various factors generating uncertainty in macroevolutionary and biogeographic inferences. Furthermore, my findings contribute to our understanding of the evolutionary dynamics as well as genetic underpinnings of trophic transitions in marine fishes, shedding light on the adaptive mechanisms driving diversification. Overall, my thesis represents an important step towards understanding the evolutionary history of marine fishes by disentangling their diversification patterns in space and time.