A few honest signals separate the two. Genuinely local festivals are scheduled by the religious or agricultural calendar rather than the tourist season, publicised mainly in the local language, and centred on participation, with families, processions, community meals, rather than a ticketed spectacle with grandstands. If most attendees are residents and nobody is selling festival merchandise, you are at the real thing.
Commercialised versions are not worthless; the famous carnivals and light festivals are often spectacular precisely because of their scale. For authenticity, apply the small-town rule: nearly every major festival has village editions held with more heart and a fraction of the crowd. Ask locals where they themselves go for that festival, which is rarely the version in the brochures.
To attend genuine celebrations respectfully, go with a local contact or homestay host when possible, observe before joining in, dress appropriately, ask before photographing rituals, and remember you are a guest at a community's event rather than an audience member at a show.