Fuel trim is the deviation from the normally expected amount of fuel the engine is injecting in response to oxygen sensor feedback. For example, if the oxygen sensors detect the engine is running lean (not enough fuel and too much air), the computer will raise the fuel trims (positive) to increase the amount of fuel being injected until the oxygen sensors detect the correct air/fuel ratio has been achieved (14.7:1). If the engine is running rich, then the amount of fuel is decreased (negative fuel trims). Fuel trims are split into two types, short term and long term. Short term is an instantaneous adjustment, while long term is a running average used as a "baseline" adjustment specific to a subset of engine operation (e.g. idle, cruise, etc). The two fuel trims added together will always equal the total fuel trim adjustment at any time. In a perfectly running engine, both short and long term fuel trims will be very close to 0. If you introduce a vacuum leak (which will cause the engine to run lean), you will first start to notice the short term trim rising. Let's say it goes up to +15 and stops. As time goes on, the long term fuel trim will start to increase. Lets say it jumps to +7. At that instant the short term trim will decrease to +8 (notice they both total +15). In another minute or two the long term trim might jump to +15, at which time the short term trim will be close to 0. The fuel control has now fully adapted to the lean condition. If you fix the vacuum leak, you will see the opposite occur (short term will ramp down to -15, and it will start to become more positive as the long term trim comes down from +15 until they both meet at 0).
You will not get a lean/rich code (e.g P0171/P0172) until the long term fuel trim reaches 20-25%. However, by the time the fuel trim reaches 10% you usually will have a problem, so that's why we use ±10% as a threshold.
Long term fuel trims are "remembered" for each phase of engine operation, which is why you see the long term trim change when you increase engine speed or load. If you reset the codes, the long term trims will start at zero and adjust the next time the engine operates in that range.
Give the computer a few days of driving to re-learn all the correct fuel trim adjustments, and if you still see excessive fuel trim numbers then you should go after fixing them.
Here's a video that talks about fuel trims in more detail: