Quite often when the subject of gearing comes up, many riders and tuners talk about anti-squat at the same time. Gearing and anti-squat are related, and when you change gearing you may also have to make a chassis change to keep anti-squat characteristics the same.
When your bike is accelerating, the weight transfer from front to rear acts to compress the rear suspension, making it "squat." Countering that, the swingarm angle and the relationship between the swingarm and chain run produce a force that acts to extend the rear suspension; this is dubbed "anti-squat." Ideally, these two forces combine to provide just the right amount of suspension compression under acceleration for optimum rear-tire traction without unloading the front tire excessively.
For example, your bike running wide on the exit of a corner when you begin to accelerate is generally a sign of the front tire unloading because of too much squat. But you can make some setup changes to add more anti-squat and offset that; these changes are especially noticeable on a more powerful bike, as there is more squat from weight transfer and more anti-squat produced from the other forces involved.
Here I will skip a lot of math and explanation, but the key is the relationship between the chain run and the swingarm. The closer the top chain run is to the swingarm pivot, and the greater the angle is between the swingarm and the chain, the more anti-squat you will have.
The changes you can make, then, to add anti-squat include: increase swingarm angle by raising rear ride height; increase the chain angle by using a smaller front sprocket or larger rear sprocket; bring the chain closer to the swingarm pivot by raising the pivot location (which also increases the swingarm angle). The opposite applies, and you can make the following changes to reduce the anti-squat effect: decrease swingarm angle by lowering rear ride height; decrease chain angle by using a larger front sprocket or smaller rear sprocket; move the chain away from the swingarm pivot by lowering the pivot location.
One scenario I often get asked about is as follows: If you change sprockets from, for example, 15-45 to 16-48, the actual ratio is unchanged but the chain is further away from the swingarm pivot; anti-squat should be less. The reality is, however, that chain angle has slightly increased at the same time, in turn increasing anti-squat. In my experience (and any calculations I've seen confirm this), a combination of sprockets that has the same ratio, such as 15-45 and 16-48 or 17-51, will have almost identical anti-squat properties.
One additional aspect to be aware of when making sprocket changes is the clearance between chain and swingarm. If the front sprocket is quite small, or the swingarm pivot excessively high, the chain could actually rub on the swingarm. All that anti-squat geometry then goes out the window and a whole new set of forces comes into play. That scenario is best avoided, and in general larger sprockets are a better choice as they keep the chain well away from the swingarm.
If you make a significant change in gearing, anti-squat characteristics can be affected and you will have to make some chassis changes to suit. And as bikes become increasingly powerful over time, anti-squat plays more of a role in chassis setup; it must be considered even on current middleweight machines, especially in race trim.