This thesis explores the dynamics of microbial communities from ecological, game theoretic and an evolutionary perspective. Chapter 1 discusses the stability of host-associated microbial ecosystems and related mathematical models and the inference of these models. Chapter 2 addresses the question of microbial interactions. Using a game-theoretic model, I explore ways in which agents (such as cross-feeding bacteria) in a multiagent system can coordinate without explicit communication channels. Chapter 3 explores the evolution of hierarchical structures of bacterial metabolic networks.