Rather late to the game, I was 20 years old when I first read a proper textbook on the topic of biology. Where my rather basic biological education in secondary school was little more than a four-year-long anatomy lesson, this book discussed broad questions ranging from the stability of entire ecosystems, down to the finer details of microbial life. When I started studying biology a year later, it was understanding the latter microscale that inspired me most. However, it quickly became clear to me that the entire concept of "understanding something" required a lot of unpacking. One course, in particular, made it crystal clear to me that just knowing and naming all the components of a system is not enough. Instead, biological systems have a lot of moving parts and self-organised structures across different scales, all of which have been selected through Darwinian evolution through natural selection. Clearly, to grasp what is happening at the microscale, the process of evolution cannot simply be tossed aside as something that has happened in the past. Instead, how microbes have evolved, and how microbes are still evolving in the soils and lakes around us, is key to understanding them.In this thesis titled 'Microbial Evolution on a Virtual Grain of Sand', I report on the research we have done that shines light on life at the microscale. With a variety of models, we tackle questions like: How can microbial diversity emerge, and how is it maintained in the long term? How is diversity impacted by Horizontal Gene Transfer? How predictable is evolution? How can microbes avoid accumulating deleterious mutations? We address these questions, and more, all by designing computational models in which bacterial ecosystems live in silico, on a Virtual Grain of Sand. 1. Introduction 1 18 1.2. Life at the microscale 1.2 Life at the microscale 20 1.2. Life at the microscale 1. Introduction 1. Introduction 24 1.3. The flexible gene content of microorganisms Figure 1.6: When sampling multiple microbial genomes from the same strain or species, the total collection of genes ranges from "open" to "closed" pangenomes.these general patterns, the exact processes shaping pangenomes are not entirely established. It is however becoming increasingly clear that HGT, i.e. the ability of microbes to take up genes from their neighbours or from the environment, plays a crucial role.