Besides compaction, the presence of moss plants also signals acidity. But grass likes a neutral soil pH. You can solve this problem by liming your soil. But don't expect a quick fix: the effects of liming are slow to take place.
But first send a soil sample to your local county extension to determine the extent of your soil's acidity. The county extension will also be able to advise you on how much lime per square foot you'll need. Apply the lime using a lawn spreader.
But if your lawn has been doing fine and shows no signs of suffering from acidity, don't apply lime. Liming is only a corrective measure, not a preventive measure. A soil that is too alkaline will also cause your lawn problems, so too much lime is as bad as not enough.