Soil that can "breathe" is healthier for all kinds of plants. Holes and pores in the earth allow air and water to get down to plant roots and make it easier for the roots to grow; the helpful microorganisms that live in the soil will be happier too. All this is just as true for your lawn as for any other place where things are growing.
In nature, soil aeration is carried out by earthworms and other small creatures that tunnel through the ground. In cold climates, water can help make pockets in the soil because it expands as it freezes and contract when it melts, leaving gaps behind. In fields and gardens, plowing and turning the soil breaks up compacted earth, but you can't do this to your lawn without tearing it up. What you can do is poke holes or even cut out small tubes that won't damage the grass. If you want to go low-tech and low-cost, you can use a sharp stick or a pitchfork to aerate your lawn, but there are also a number of different implements intended especially for this job: there are spiked wheels that you can push across the lawn, or spiky clip-ons for your shoes. You can attach spikes to tractor wheels and even buy gas-powered aerators.
When the turf has a lot of traffic and the soil is significantly compacted, it may be better to use a core aerator that takes out whole plugs of earth. The more expensive and complicated aerators can often be rented, or you can have professional landscapers can do the job for you.
When and how often you aerate depends on the type of soil, the type of grass and the amount of traffic. It's best to do your poking during the grass's growth season and when the soil is moist but not soaked. Lawns that get trampled a lot will need more aeration than those only bird-feet walk on. Be sure you know where underground cables and pipes are before you start attacking the turf, and mind your toes!