As well as not asking the airplane wings to lift more weight then the manufacturer intended, you need to make sure that the front-to-back balance of the weight is acceptable. To do this you take into consideration the weight of each component of the load, and the location at which it is loaded.
Weight, Arm and Reference Datum
Consider a teeter-totter (or a see-saw, whatever you call that spinal injury-inducing levered plaything in your neck of the woods). If you weren't denied the opportunity to have played on one, you know that if you put an adult (or two kids) at one end and one kid at the other, it's hard for those on the heavy end to push off the ground, and easy to launch the kid into orbit if the adult lets his end come down hard. For easy teeter-tottering, you have to pile up more kids at the light end, or have mom sit closer to the fulcrum (the hinge supporting the see-saw) where her weight has less leverage. The effect of someone sitting on the teeter-totter is directly proportional to how much she weighs, and to how far she is from the middle. If Mom weighs twice as much as Junior she has to sit halfway between the end and the middle to balance Junior at the other end. Mathematically put, the teeter-totter balances when Mom's weight times her distance from the middle equals Junior's weight times his distance from the middle.
The distance out is called arm and the combined effect of weight and distance, the weight times the arm, is called moment. As Mom's moment (say 60 kg x 2 m) tends to push the see-saw one way and Junior's (30 kg x 4 m) pushes it the other way, and they are equal, they balance. I can also call Mom's arm (distance to the right) positive and Junior's arm (to the left) negative, so that the total moment of the system becomes (60 x 2) + (30 x -4) = 0. A total moment of zero means no moment, so no tendency to move about the fulcrum and the see-saw balances. Whee. (I'm ignoring the weight of the teeter-totter itself, because presumably it's balanced). If Mom sits all the way out to her end, her arm increases to 4 (further to the right), so the total moment becomes (60 X 4) + (30 x -4) = 120. That 120 is a measure of the unbalancedness. [Physicists: please don't beat me up for using kilograms instead of newtons for weights here, and then ignoring dimensions. I know the difference. I just don't feel anything is added to the explanation by multiplying both sides of the equation by g.] The point I measure from is called the reference datum, and its position is irrelevant, as long as everything is measured from the same place.
Here is an example to explain that last italicized phrase. I postulated an eight metre teeter-totter, and the measurements I gave were from the middle. That wasn't too hard, as the middle is easy to find, but it did require the measurements in one direction to be negative, with some people find inconvenient. We could take the same teeter-totter and measure from one end, say Mom's end. So Mom's moment, when she is halfway to the middle in order to balance Junior, becomes (60 x 2 = 120) and Junior's becomes (30 x 8 = 240), for a total moment of 360. If we put Mom back at the end now, her arm would be zero, so the total moment would be (0 x 60) + (30 x 8) = 240. Notice that 360 (the ideal) minus 240 (the moment with Mom at the end) is 120. The unbalancedness is still 120. I could even measure from the swingset or from the edge of the playground and get the same result.
Centre of Gravity
When the reference datum is an arbitrary point, the moment, the measurement of unbalancedness, is an arbitrary number, and these numbers get quite large when you're dealing with long, heavy airplanes. So we put it all together to get a non-arbitrary number called the centre of gravity. Weight multiplied by arm equals moment not only for each component of the system, but also for the sum of all its components. And if weight times arm equals moment, then moment divided by weight equals arm. Back to the total weight and moment of the unbalanced teeter-totter.
Mom and Junior together make 90 kg, so that's the weight. And I already totalled the moments for each reference datum.
Measuring from the middle: 120 / 90 = 1.33
Measuring from the end: 240 / 90 = 2.67
Now, measuring 1.33 m from the middle towards Mom's end reaches the same point as measuring 2.67 m from Mom's end toward the middle. That is the point at which the teeter-totter would balance with Mom at one end and Junior at the other. That's still called the arm of the loaded airplane, but more commonly called the centre of gravity, often written CofG and pronounced see-uhv-gee.
For the airplane, every manufacturer defines a reference datum, and publishes a list of the arms of every point at which weight will be loaded, such as each fuel tank, the pilot seat, each row of passenger seating, and each baggage area. The manufacturer also publishes a chart showing the acceptable range of moment and or centre of gravity (CofG). It's the pilot's job to calculate the total moment or CofG of the loaded airplane and ensure that it falls within the limits of the chart.
Here's an example, from a Piper Seneca. It's a fairly simple airplane, and I've simplified it further by not using one of the baggage areas. Note that this calculation applies to a particular Piper Seneca, one that once belonged to the Winnipeg Flying Club. A different Piper Seneca would have a different empty weight and arm.
We'll imagine a 200 lb pilot, 460 pounds of passengers, in two different rows, and 50 lbs of baggage in the back. The first line of the table I read off the individual airplane weight and balance document. The other weights I get from inspection. The other arms are from the Aircraft Flight Manual, based on a reference datum near the nose of the airplane. The moments are the product of the weights and arms. The total weight and total moment are simply a sum of the individual weights and moments. And the total CofG is the total moment, divided by the total weight.
The total weight of 4204 happens to be four pounds over the maximum weight allowed by the manufacturer, while the CofG is just forward of the maximum 94.6. In this case I would accept the load, because I know I will burn about eight pounds of fuel during taxi, runup and on the takeoff roll. By the time the airplane takes to the air, it will be within limits. The manufacturer tells me that the effect of fuel burn on CofG for this airplane is negligible.
It bears noting that this airplane has an additional baggage area in the nose, and two unoccupied seats. Three medium-weight passengers and their carry-ons is enough to load the airplane to its maximum. An airplane doesn't have to be stuffed to be full.
If the CofG numbers get unwieldy, there's another way to express them. I'll tell you about %MAC calculations some other time. And this isn't one of my best explanations, so ask away if I've said anything confusing.