If you don’t travel regularly but collect airline mileage, your points may expire due to inactivity. I’ve lost a bunch of mileage with Alaskan Airlines by losing track.
With most airlines in alliances like OneWorld and Star Alliance, it is easier to collect points and join only a few programs. You can enter your membership number during online check-in. It is a major pain to claim mileage after a flight had been taken since you need to mail your original boarding passes and tickets.
With both United Mileage Plus and America Aadvantage, points will expire after 18 months of your last activity. Being in Canada, I found the best way to keep your account active is to sign up with their affiliated dining programs and cross the border to Bellingham for lunch and a shopping trip. American and United use the same program but branded to their own airline. You register separately for it and link a credit card and your mileage account. All you need to do is to have a meal at a participating restaurant and charge it to the credit card you have registered. Mileage should appear on your account in a couple of weeks. They used to have Canadian restaurants in the program but that ended several years ago.
The only other frequent flyer program I’m enrolled in is Delta Skymiles and mileage doesn’t expire with Delta.