The iPhone XS battery, as well as that of the iPhone XS Max, csists of two different lithium-i cells formed in the form of an L (in the phe, not your forehead).
By joining a large battery instead of two, you can remove a small amount of packaging and remove the small space between them, maximizing your capacity. Picture two small train cars in a row. In additi to that, put another car that is as lg as both small cars combined. You can fit more in the single because you eliminate two walls and some space. The same principle applies.
We all tease Apple that all its products become thinner, but it requires incredible technical delights to actually do that. Featured image credit goes to iFixit.