The way that you get points for travel is through use of your credit card.
Some credit cards offer you travel points for the money you spend on the credit card and as long as you pay back the credit card purchases on time then you can build up the points.
When you accumulate enough credit card travel points then you can use those travel points to get a free flight through an airline.
You earn points for the money you spend with your credit card and then as those travel points add up you can get the free flight and sometimes even a free hotel depending on the credit card company.
Not all credit card companies offer travel points but some do.
You really don't get free flights or free travel though because you have to spend money through your credit card and then pay interest on that credit card purchase.
That is the way the credit card companies make the profit which is how they can give you free travel after a certain amount of points racked up.