Heterogeneous networks, consisting of macrocells overlaid with small cells (e.g., femtocells, picocells, microcells) provide a fast, flexible, cost-efficient, and fine-tuned design and expansion for existing cellular wireless networks to satisfy the ever increasing demand for network capacity. In HetNets, small cells serve as offloading spots in the radio access network to offload users and their associated traffic from congested macrocells. However, due to their large-scale deployment in random locations, limited transmit power, and the lack of complete coordination, the coexistence and efficient operation of small cells is very challenging. In this article, we discuss the coexistence challenges posed to small cells and show that, with cognition capabilities (e.g., achieved through spectrum sensing), small cells can overcome the posed challenges and efficiently coexist in a multitier cellular wireless network. Then we discuss a statistical tool, stochastic geometry, to model and analyze heterogeneous cellular networks. We give two examples where the stochastic geometry tools can be exploited to obtain insightful design guidelines. First, we exploit stochastic geometry to evaluate the load of each network tier and study different offloading techniques used to control this load. Second, we exploit stochastic geometry to maximize frequency reuse efficiency through spectrum sensing design for channel access and compare two channel access techniques based on spectrum sensing.