[Póster presentado a]: XXII Congreso de Física Estadística (FisEs'18), Madrid, 18-20 de octubre de 2018.The typical human personal social network contains about 150 relationships including kin, friends, and acquaintances, organized into a set of hierarchically inclusive layers of increasing size but decreasing emotional intensity. Data from a number of different sources reveal that these inclusive layers exhibit a constant scaling ratio of ∼3. While the overall size of the networks has been connected to our cognitive capacity, no mechanism explaining why the networks present a layered structure with a consistent scaling has been proposed. Here we show that the existence of a heterogeneous cost to relationships (in terms of time or cognitive investment), together with a limitation in the total capacity an individual has to invest in them, can naturally explain the existence of layers and, when the cost function is linear, explain the scaling between them. We develop a one-parameter Bayesian model that fits the empirical data remarkably well. In addition, the model predicts the existence of a contrasting regime in the case of small communities, such that the layers have an inverted structure (increasing size with increasing emotional intensity). We test the model with five communities and provide clear evidence of the existence of the two predicted regimes. Our model explains, based on first principles, the emergence of structure in the organization of personal networks and allows us to predict a rare phenomenon whose existence we confirm empirically