This thesis analyses the role of workplace heterogeneity in determining pay differentials between workers, employing a range of reduced-form tools and using detailed matched employer-employee administrative data. The first chapter, co-authored with Alessandra Casarico, studies the contribution of differences in firm pay policy to the gender wage gap in Italy, decomposing them into a between-firm component of sorting of women in low-pay firms and a within-firm component related to differences in bargaining power between gender. Building on Card et al. (2016), we investigate the contribution of firms to the gender gap in earnings at different deciles of the earnings distribution, by age and cohort, and over time. Using a linked employer-employee dataset for Italy, covering the universe of workers in the private sector, we show that the gap in firm pay policy explains on average 30 percent of the gender pay gap in the period 1995-2015. When we decompose differences in firm pay policy into sorting and bargaining, we find that sorting of women in low pay firms dominates on average and at the bottom of the distribution, whereas bargaining prevails at the top and has increased in importance over time. We explore gendered mobility patterns towards firms with more generous pay policy as a driver of sorting and exploit exogenous variation in the gender composition of board of directors to study the impact of firm environment on gender differences in bargaining power. We find that women are less likely to move towards more generous firms, especially in the event of firm closures, and that exogenous changes in the gender balance in leadership positions reduce the gender gap in bargaining power, indicating that the latter is partly malleable to institutional changes. The second chapter, co-authored with Long Hong, studies the contribution of coworkers on future wage growth. Using linked employer-employee data for the Veneto region in Italy, we explore coworkers' effect on wage growth in two directions. First, using a novel estimation method and accounting for the endogenous sorting of workers into peer groups and firms, we estimate the impact of average peer quality on future wages. We find that a 10 percent rise in peer quality increases one's wage in the next year by 1.8 percent. The effect decreases gradually over time and becomes about 0.7 percent after five years. Second, we delve deeper into the channels that identify the peer effect and, using an event-study specification around mobility episodes, we study how the entry and leave of high-quality and low-quality workers affect wages of movers and coworkers. We find that hiring a high-quality worker is an important driver of wage growth, as well as separating from a low-quality worker. Movers experience an immediate gain when moving into high-quality peers. Knowledge spillover and peer pressure are likely important mechanisms in explaining our findings. The third chapter studies the worker-, firm- and sector-level adjustment to robots. Combining detailed matched employer-employee data for Italy over the period 1994-2018 with robot counts by industry in the manufacturing sector, we show that automation adoption expands employment opportunities and reduces labour market transitions. At the worker level, those who are either high-skilled, white-collar, or employed in more productive firms experience employment and earnings gains. Meanwhile at the firm-level, sales and value added increase, while employment outcomes are highly heterogeneous between ex-ante more and less productive firms; with the former increasing employment of all workers, irrespective of their skill level, and the latter reducing it. These changes in labour demand are further inspected at the sector-level, where an event study approach following spikes in automation adoption reveals a negative effect of automation on labour market sorting. Overall, this chapter provides evidence on the impact of automation on a country with a strong manufacturing sector and a relatively rigid labour market. When exploring heterogeneous effects across workers and firms, there is a clear distinction between "winners" and "losers"', with less skilled workers facing bigger losses from technology adoption.