First, there are special provisions for 529 accounts opened by grandparents with themselves as custodians — as opposed to parental 529 plans. The family doesn’t have to include the grandparent-owned accounts on the FAFSA form. But that account should be saved to pay for the final year of college. If used earlier then it is considered a “student” asset — and weighs far more heavily against the family in the aid formula.
Now, as to your question — if for any reason the grandchild doesn’t go to college, it can be used for another sibling in the family, or another grandchild from from one of your other children. But if it is not used at all (or if the kids turn out to be jerks) then the grandparent can take the money back paying a 10% penalty and ordinary income taxes on any gains.