This thesis contains two chapters on the sources of residual wage inequality. The first chapter contributes to attempts to explain the increase in wage inequality in the U.S. labor market over the past few decades. I address the question of how much of this increase can be attributed to factors associated with job-to-job mobility. For this purpose, I develop a search model with on-the-job search, anticipation of job destruction, and costs to workers when switching jobs. The quantitative analysis involves calibrating the model to match characteristics of the U.S. labor market in the mid-1980s and the mid-2000s. I find that changes in job-to-job mobility have a significant quantitative impact on residual wage inequality. In particular, up to one-half of the observed inequality increase is accounted for by the composite effect of three mobility determinants. Among them, the arrival probability of offers on the job plays the leading role, whereas the impact of job switching costs is negligible. In addition, changes in the conditions of job loss amplify the effect of offer arrivals. In the second chapter, joint work with Arpad Abraham and Fernando Alvarez-Parra, we study the impact of moral hazard in labor contracts on residual wage inequality. The tool of our analysis is a search model with job-to-job mobility and firm competition for workers, where firms offer long-term contracts to risk-averse workers in the presence of repeated moral hazard. For a quantitative analysis, we calibrate the model to match characteristics of the U.S. labor market derived from micro data from the mid-2000s. We find that, on balance, moral hazard increases residual wage inequality by around six percent. The direct effect of providing incentives through wage variation accounts for a moderate contribution to inequality increase. In addition, moral hazard affects the wage distribution through several indirect effects, as firms adjust the levels of effort implemented and the wage offers made to workers in response to increased effort costs. Through their particularly strong impact on the lower parts of the wage distribution, such effects contribute substantially to the overall rise in inequality. The main reason is that, under moral hazard, low wage workers spend significantly less effort.