In the Next.js App Router, how is a route group (folder) different from a private _folder? When do you use each?
Suggested answer
Both are folder naming conventions inside app, but they solve two different problems.
A route group is a folder whose name is in parentheses, like (site) or (shop). Next.js uses it to group pages but leaves the group name out of the URL: app/(site)/posts/page.tsx is still /posts. Its main use is giving a set of pages their own shared layout. For example, a blog's public pages need a header and footer and are generated ahead of time, while the admin pages need their own frame and are built fresh on every visit. Put the public pages in a (site) group with its own layout and the two sides stay separate without the URLs changing.
A private folder has a name starting with an underscore, like _components. Next.js ignores that folder and all its subfolders when building routes, so it's a place to keep non-page code (components, helpers) right next to a page.
A common follow-up: even without the underscore, a file in app doesn't become a page unless it's a page or route file. So _folder is mainly about making the intent clear and avoiding clashes with Next.js's special file names.
Bonus points: mention that two layouts can apply to the same / (the root layout and the group's layout) while wrapping different scopes.