A 529 is a tax-advantaged account for education expenses. Contributions are made with after-tax money, but growth is tax-free and withdrawals are tax-free when used for qualified education costs — tuition, fees, room and board, books and equipment. Many states also offer a state income tax deduction or credit for contributions to their own plan.
The account belongs to you, not the child, so you keep control. If plans change you can switch the beneficiary to another family member, and under current rules a limited amount of leftover funds can be rolled into the beneficiary's Roth IRA subject to conditions. Non-qualified withdrawals are taxed on the growth plus a 10% penalty, so it's worth not over-funding.