Using game theory and reinforcement learning, we created and analyzed generalized agent-based and compartmental models of hepatic toxin elimination processes to explore plausible causes of hepatic functional zonation. We considered a general situation in which a group of protective agents (analogous to liver cells) cooperate and self-organize their efforts to minimize optimally the negative effects of toxin intrusions. Following a totally different approach, we constructed a physiologically based model of a two-zoned liver to study the physiological consequences of zonation. The results of the two models support the hypothesis that liver zonation might be a consequence of an optimal strategy for toxin clearance.