Previous work indicates that tropical forest can exist as an alternative stable state to savanna. Therefore, perturbation by climate change or human impact may lead to crossing of a tipping point beyond which there is rapid forest dieback that is not easily reversed. A hypothesized mechanism for such bistability is feedback between fire and vegetation, where fire spreads as a contagion process on grass patches. Theoretical models have largely implemented this mechanism implicitly, by assuming a threshold dependence of fire spread on flammable vegetation. Here, we show how the nonlinear dynamics and bistability emerge spontaneously, without assuming equations or thresholds for fire spread. We find that the forest geometry causes the nonlinearity that induces bistability. We demonstrate this in three steps. First, we model forest and fire as interacting contagion processes on grass patches, showing that spatial structure emerges due to two counteracting effects on the forest perimeter: forest expansion by dispersal and forest erosion by fires originating in adjacent grassland. Then, we derive a landscape-scale balance equation in which these two effects link forest geometry and dynamics: Forest expands proportionally to its perimeter, while it shrinks proportionally to its perimeter weighted by adjacent grassland area. Finally, we show that these perimeter quantities introduce nonlinearity in our balance equation and lead to bistability. Relying on the link between structure and dynamics, we propose a forest resilience indicator that could be used for targeted conservation or restoration.